Skip to content

pyflightstream.cases.workflows (stable)

Generated from the docstrings at build time: every one of the 159 names in the __all__ of pyflightstream.cases.workflows has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

Workflows: a run TYPE that builds the whole script by itself.

Pipeline role: the builder half of the file-managed modality. A recipe is a function a USER writes and the loop imports by reference; a WORKFLOW is a run type this package already knows how to build, named by the matrix's WORKFLOW column and resolved by TABLE LOOKUP in :data:WORKFLOWS. That difference is the whole point of the module: a workflow cannot be supplied from outside, so a study can be run by somebody who writes no Python at all.

Three properties follow from the table, and each is enforced here rather than described:

  • Nothing is imported by reference. There is no importlib in this module and no reference string that reaches one. A name either is in the table or is refused against the table's own contents.
  • A case names ONE builder. A case naming both a workflow and a user recipe is refused naming both, and a case naming neither is refused naming the types that exist. Two builders is not a merge, it is a question nobody answered.
  • A workflow takes the solver BUILD as an input. It declares the commands it always emits and :func:covered_builds DERIVES the builds it covers from the command database. A build outside that range is refused before the first line is emitted, naming the build, the range and the commands that forced it. Nothing here is a hand-written version list, so a build registered tomorrow joins the range the moment its evidence lands.

WHERE THE NUMBERS COME FROM. A workflow reads the case, and a case converted from a run matrix carries its VAR_NAMES_VALUES cell as strings (the matrix reader has no types to give them). So every value this module takes off a case is converted HERE, with a refusal that names the case and the KEY, rather than at the command, whose refusal would name only the command and send the user to the command reference instead of to the cell they typed.

THE WORKSPACE CONVENTIONS ARRIVE AS DATA. workspace sits ABOVE cases in the layer order, so a workflow can never import the naming template that rendered its output names. :class:WorkflowConventions is what the run layer passes down instead.

AND SO DOES THE GEOMETRY, for the same reason and by a different route. A workflow never resolves an input-library id: by the time a builder runs, :attr:pyflightstream.cases.SimCase.geometry already holds the STAGED path of the case's own copy, put there by the campaign loop after it hashed those bytes into the record. What the builder does with it is open it, first, before anything else (:func:_open_geometry).

The builders open the declared geometry before configuring the simulation and apply the row's symmetry declaration. A periodic rotor sector therefore keeps its declared periodicity.

Used in the guides

pyflightstream.cases.workflows.IGNORE_MISSING_FAMILIES_VARIABLE module-attribute

IGNORE_MISSING_FAMILIES_VARIABLE = "IGNORE_MISSING_FAMILIES"

pyflightstream.cases.workflows.PER_ROTOR_REDUCTIONS module-attribute

PER_ROTOR_REDUCTIONS: tuple[str, ...] = (
    "phase_locked",
    "per_blade",
)

pyflightstream.cases.workflows.ROTORS_KEY module-attribute

ROTORS_KEY = 'rotors'

Advanced

pyflightstream.cases.workflows.ACTUATOR_KEYS module-attribute

ACTUATOR_KEYS: tuple[str, ...] = (
    ACTUATOR_VARIABLE,
    ACTUATOR_RPM_VARIABLE,
    ACTUATOR_THRUST_VARIABLE,
    PROFILE_VARIABLE,
)

pyflightstream.cases.workflows.ACTUATOR_PROFILE_COPY_SUFFIX module-attribute

ACTUATOR_PROFILE_COPY_SUFFIX = '.actuator_profile.txt'

pyflightstream.cases.workflows.ACTUATOR_RPM_VARIABLE module-attribute

ACTUATOR_RPM_VARIABLE = 'ACTUATOR_RPM'

pyflightstream.cases.workflows.ACTUATOR_THRUST_VARIABLE module-attribute

ACTUATOR_THRUST_VARIABLE = 'ACTUATOR_THRUST'

pyflightstream.cases.workflows.ACTUATOR_VARIABLE module-attribute

ACTUATOR_VARIABLE = 'ACTUATOR'

pyflightstream.cases.workflows.ADDITIONAL_POST_BUILDS module-attribute

ADDITIONAL_POST_BUILDS: tuple[str, ...] = ('26.124',)

pyflightstream.cases.workflows.ADDITIONAL_PPROC_VARIABLE module-attribute

ADDITIONAL_PPROC_VARIABLE = 'ADDITIONAL_PPROC'

pyflightstream.cases.workflows.ADVANCE_RATIO_VARIABLE module-attribute

ADVANCE_RATIO_VARIABLE = 'ADVANCE_RATIO'

pyflightstream.cases.workflows.BASE_REGIONS_VARIABLE module-attribute

BASE_REGIONS_VARIABLE = 'BASE_REGIONS'

pyflightstream.cases.workflows.BATCH_DIR module-attribute

BATCH_DIR = 'batch'

pyflightstream.cases.workflows.BATCH_STEM_PREFIX module-attribute

BATCH_STEM_PREFIX = 'BATCH-'

pyflightstream.cases.workflows.BLADES_VARIABLE module-attribute

BLADES_VARIABLE = 'BLADES'

pyflightstream.cases.workflows.BuildCapabilities dataclass

BuildCapabilities(build: str, unsteady_actions: bool)

What one build can do, derived from its command database and nothing else.

Never kept as a list: a command row landing for a build changes that build's capabilities the moment it lands, and the goal's support-matrix test re-derives them on every run.

Attributes:

Name Type Description
build str

The canonical build identifier.

unsteady_actions bool

Whether the build documents SET_NEW_UNSTEADY_SOLVER_ACTION, the per-step action every actions-only feature rests on.

of classmethod

of(view: VersionView) -> BuildCapabilities

Derive the capabilities of the build view answers for.

for_build classmethod

for_build(
    build: str, *, registry: CommandRegistry | None = None
) -> BuildCapabilities

Derive the capabilities of a build named as a matrix FS_BUILD cell names it.

Examples:

>>> BuildCapabilities.for_build("26.120").unsteady_actions
False
>>> BuildCapabilities.for_build("26.123").unsteady_actions
True

pyflightstream.cases.workflows.BuildCapabilityError

Bases: WorkflowCoverageError

A row asks a build for a feature that only a capability the build lacks provides.

Raised by :func:march_strategy before the first emission, so a plan reports the point BLOCKED with this sentence and nothing is spent. The message names the build, each feature the row asked for, the builds that do document the capability, and what to write instead. A subclass of :class:WorkflowCoverageError, because it is the same kind of answer: the row is well formed and this build cannot run it as written.

pyflightstream.cases.workflows.CUMULATIVE_LOG_SUFFIX module-attribute

CUMULATIVE_LOG_SUFFIX = '.cumulative-log.txt'

pyflightstream.cases.workflows.DELTA_THETA_VARIABLE module-attribute

DELTA_THETA_VARIABLE = 'DELTA_THETA'

pyflightstream.cases.workflows.DELTA_TIME_VARIABLE module-attribute

DELTA_TIME_VARIABLE = 'DELTA_TIME'

pyflightstream.cases.workflows.END_OF_RUN_EXPORT_KINDS module-attribute

END_OF_RUN_EXPORT_KINDS: tuple[str, ...] = (
    "force_distributions",
    "plot_residuals",
    "plot_loads",
    "plot_sections_cp",
)

pyflightstream.cases.workflows.EXPORT_LOG_VARIABLE module-attribute

EXPORT_LOG_VARIABLE = 'EXPORT_LOG'

pyflightstream.cases.workflows.EXPORT_UNSTEADY_AFTER_ITER_VARIABLE module-attribute

EXPORT_UNSTEADY_AFTER_ITER_VARIABLE = (
    "EXPORT_UNSTEADY_AFTER_ITER"
)

pyflightstream.cases.workflows.EXPORT_UNSTEADY_AFTER_REV_VARIABLE module-attribute

EXPORT_UNSTEADY_AFTER_REV_VARIABLE = (
    "EXPORT_UNSTEADY_AFTER_REV"
)

pyflightstream.cases.workflows.EXPORT_UNSTEADY_LAST_ITER_VARIABLE module-attribute

EXPORT_UNSTEADY_LAST_ITER_VARIABLE = (
    "EXPORT_UNSTEADY_LAST_ITER"
)

pyflightstream.cases.workflows.EXPORT_UNSTEADY_LAST_REV_VARIABLE module-attribute

EXPORT_UNSTEADY_LAST_REV_VARIABLE = (
    "EXPORT_UNSTEADY_LAST_REV"
)

pyflightstream.cases.workflows.ExportWindow dataclass

ExportWindow(
    stated_form: str,
    stated_value: float,
    steps: int,
    rpm: float | None,
    delta_time_s: float | None,
    time_iterations: int,
    delta_theta_deg: float | None = None,
    clipped_from_steps: int | None = None,
)

The span the expensive exports apply over, counted backwards.

The window is stated ONCE, in whichever unit the user thinks in, and every other form is derived. The record carries both, so a later reader can see which was written and which was computed.

Attributes:

Name Type Description
stated_form str

degrees, steps or revolutions: the form the user wrote.

stated_value float

The value they wrote, verbatim and unconverted.

steps int

The derived span in solver time steps.

rpm float or None

Rotor speed in rev/min the degrees are counted on; None where the window was stated in steps and no rotor speed was given.

delta_time_s float or None

Solver physical time step in s.

time_iterations int

Physical time steps in the whole run; the window ends here.

delta_theta_deg float or None

The azimuthal step the clock was stated with, where it was.

clipped_from_steps int or None

The span the row asked for, in solver steps, when it was longer than the run and was cut to the whole run; None when nothing was cut.

steps_per_revolution property

steps_per_revolution: float | None

Solver steps in one revolution, or None without the inputs.

FROM THE AZIMUTHAL STEP WHERE THE CLOCK WAS STATED THAT WAY: a revolution is 360 degrees, so a ten-degree step is thirty-six steps exactly. Otherwise one revolution lasts 60 / rpm seconds and one step lasts delta_time_s seconds, so a revolution is 60 / (rpm * delta_time_s) steps.

Use the angle first. The emitted step is rounded to the reference precision, so deriving revolutions from seconds can yield 36.0238 steps where the run resolves 36, or a one-revolution window of 359.77 degrees instead of 360.

degrees property

degrees: float | None

The window in degrees of rotation, or None without a rotor speed.

revolutions property

revolutions: float | None

The window in revolutions, or None without a rotor speed.

window_steps

window_steps() -> tuple[int, int]

Return the inclusive (first_step, last_step) span of the window.

Counted BACKWARDS from the end of the run, which is where the physics of interest is: the last blade passage of a run that has settled, not the first of one that has not.

record

record() -> dict[str, object]

Both forms, for the run record.

Returns:

Type Description
dict

form and stated are what the user wrote; steps, degrees and revolutions are derived, and the last two are None where no rotor speed was declared, because a step window with no rotor speed cannot state its own degrees and inventing one is worse than reporting none. clipped_from_steps appears only when the stated window was longer than the run and was cut to it.

from_case classmethod

from_case(case: SimCase) -> ExportWindow

Build the window from what the row declares.

Reads LAST_REVS_AVG or LAST_ITERS_AVG alongside the clock.

pyflightstream.cases.workflows.FREESTREAM_DIR module-attribute

FREESTREAM_DIR = 'freestreams'

pyflightstream.cases.workflows.FREESTREAM_FORMS module-attribute

FREESTREAM_FORMS: Mapping[str, str] = MappingProxyType(
    {".txt": "STRUCTURED", ".dat": "UNSTRUCTURED"}
)

pyflightstream.cases.workflows.FREESTREAM_VARIABLE module-attribute

FREESTREAM_VARIABLE = 'FREESTREAM'

pyflightstream.cases.workflows.FULL_POLAR_STEM module-attribute

FULL_POLAR_STEM = 'FULL-POLAR'

pyflightstream.cases.workflows.GEOMETRY_ROW_KEYS module-attribute

GEOMETRY_ROW_KEYS: tuple[str, ...] = (
    MESH_ROUTE_VARIABLE,
    GEOM_CONFIGURATION_VARIABLE,
    GEOM_VARIANT_VARIABLE,
    GEOM_PARAMS_VARIABLE,
    MESH_CONTROLS_VARIABLE,
)

pyflightstream.cases.workflows.GEOMETRY_VARIABLE module-attribute

GEOMETRY_VARIABLE = 'GEOMETRY'

pyflightstream.cases.workflows.GEOM_CONFIGURATION_VARIABLE module-attribute

GEOM_CONFIGURATION_VARIABLE = 'GEOM_CONFIGURATION'

pyflightstream.cases.workflows.GEOM_PARAMS_VARIABLE module-attribute

GEOM_PARAMS_VARIABLE = 'GEOM_PARAMS'

pyflightstream.cases.workflows.GEOM_VARIANT_VARIABLE module-attribute

GEOM_VARIANT_VARIABLE = 'GEOM_VARIANT'

pyflightstream.cases.workflows.JOB_END_SUFFIX module-attribute

JOB_END_SUFFIX = '.end.json'

pyflightstream.cases.workflows.JOB_LOG_SUFFIX module-attribute

JOB_LOG_SUFFIX = '.job-log.txt'

pyflightstream.cases.workflows.LAST_ITERS_AVG_VARIABLE module-attribute

LAST_ITERS_AVG_VARIABLE = 'LAST_ITERS_AVG'

pyflightstream.cases.workflows.LAST_REVS_AVG_VARIABLE module-attribute

LAST_REVS_AVG_VARIABLE = 'LAST_REVS_AVG'

pyflightstream.cases.workflows.LOADS_SELECTION_KEYS module-attribute

LOADS_SELECTION_KEYS: tuple[str, ...] = (
    "analysis_families",
    "load_units",
    "inviscid_loads",
)

pyflightstream.cases.workflows.LOG_OUTPUT_VARIABLE module-attribute

LOG_OUTPUT_VARIABLE = 'LOG_OUTPUT'

pyflightstream.cases.workflows.MARCH_ACTIONS module-attribute

MARCH_ACTIONS: MarchStrategy = 'actions'

pyflightstream.cases.workflows.MARCH_SINGLE module-attribute

MARCH_SINGLE: MarchStrategy = 'single_march'

pyflightstream.cases.workflows.MESH_CONTROLS_VARIABLE module-attribute

MESH_CONTROLS_VARIABLE = 'MESH_CONTROLS'

pyflightstream.cases.workflows.MESH_ROUTE_VARIABLE module-attribute

MESH_ROUTE_VARIABLE = 'MESH_ROUTE'

pyflightstream.cases.workflows.MOTIONS_DIR module-attribute

MOTIONS_DIR = 'motions'

pyflightstream.cases.workflows.MOTIONS_VARIABLE module-attribute

MOTIONS_VARIABLE = 'MOTIONS'

pyflightstream.cases.workflows.MOTION_TABLE_KEY module-attribute

MOTION_TABLE_KEY = 'TABLE'

pyflightstream.cases.workflows.MOTION_TABLE_PATH_KEY module-attribute

MOTION_TABLE_PATH_KEY = 'TABLE_PATH'

pyflightstream.cases.workflows.MOTION_TABLE_SHA256_KEY module-attribute

MOTION_TABLE_SHA256_KEY = 'TABLE_SHA256'

pyflightstream.cases.workflows.MOTION_TABLE_TYPES module-attribute

MOTION_TABLE_TYPES: tuple[str, ...] = (
    "POSITION-TIME",
    "VELOCITY-TIME",
)

pyflightstream.cases.workflows.MOTION_TABLE_TYPE_KEY module-attribute

MOTION_TABLE_TYPE_KEY = 'TABLE_TYPE'

pyflightstream.cases.workflows.MOVING_BOUNDARIES_VARIABLE module-attribute

MOVING_BOUNDARIES_VARIABLE = 'MOVING_BOUNDARIES'

pyflightstream.cases.workflows.PASSAGE_POSITIONS_VARIABLE module-attribute

PASSAGE_POSITIONS_VARIABLE = 'PASSAGE_POSITIONS'

pyflightstream.cases.workflows.PERIODIC_COPIES_VARIABLE module-attribute

PERIODIC_COPIES_VARIABLE = 'PERIODIC_COPIES'

pyflightstream.cases.workflows.PROBE_POSITIONS_MARKER module-attribute

PROBE_POSITIONS_MARKER = '# pyflightstream probe positions'

pyflightstream.cases.workflows.PROBE_POSITION_COLUMNS module-attribute

PROBE_POSITION_COLUMNS: tuple[str, ...] = (
    "PROBE",
    "X",
    "Y",
    "Z",
    "FRAME",
)

pyflightstream.cases.workflows.PROBE_PROFILE_DIR module-attribute

PROBE_PROFILE_DIR = 'profiles'

pyflightstream.cases.workflows.PROFILE_VARIABLE module-attribute

PROFILE_VARIABLE = 'PROFILE'

pyflightstream.cases.workflows.QSTEADY_ROTOR module-attribute

QSTEADY_ROTOR = 'qsteady_rotor'

pyflightstream.cases.workflows.RAD_PER_S_PER_REV_PER_MIN module-attribute

RAD_PER_S_PER_REV_PER_MIN = 2.0 * math.pi / 60.0

pyflightstream.cases.workflows.RAW_BEFORE_KEY module-attribute

RAW_BEFORE_KEY = 'BEFORE'

pyflightstream.cases.workflows.RAW_COMMAND_KEY module-attribute

RAW_COMMAND_KEY = 'COMMAND'

pyflightstream.cases.workflows.RAW_FILE_KEY module-attribute

RAW_FILE_KEY = 'FILE'

pyflightstream.cases.workflows.RAW_MESH_FORMATS module-attribute

RAW_MESH_FORMATS: Mapping[str, str] = MappingProxyType(
    {".obj": "OBJ", ".stl": "STL"}
)

pyflightstream.cases.workflows.RAW_VARIABLE module-attribute

RAW_VARIABLE = 'RAW'

pyflightstream.cases.workflows.REDUCTION_NAMES module-attribute

REDUCTION_NAMES: tuple[str, ...] = (
    "time_average",
    "phase_locked",
    "per_blade",
)

pyflightstream.cases.workflows.REVOLUTIONS_VARIABLE module-attribute

REVOLUTIONS_VARIABLE = 'REVOLUTIONS'

pyflightstream.cases.workflows.ROTATE_VARIABLE module-attribute

ROTATE_VARIABLE = 'ROTATE'

pyflightstream.cases.workflows.ROTORLESS_REFUSED_KEYS module-attribute

ROTORLESS_REFUSED_KEYS: tuple[str, ...] = (
    MOVING_BOUNDARIES_VARIABLE,
    ROTOR_AXIS_VARIABLE,
    ROTOR_ORIGIN_VARIABLE,
    RPM_SIGN_VARIABLE,
    RPM_VARIABLE,
)

pyflightstream.cases.workflows.ROTOR_AXIS_VARIABLE module-attribute

ROTOR_AXIS_VARIABLE = 'ROTOR_AXIS'

pyflightstream.cases.workflows.ROTOR_ORIGIN_POINT_KEY module-attribute

ROTOR_ORIGIN_POINT_KEY = 'ROTOR_ORIGIN_POINT'

pyflightstream.cases.workflows.ROTOR_ORIGIN_VARIABLE module-attribute

ROTOR_ORIGIN_VARIABLE = 'ROTOR_ORIGIN'

pyflightstream.cases.workflows.ROTOR_SHEDDING_VARIABLE module-attribute

ROTOR_SHEDDING_VARIABLE = 'ROTOR_SHEDDING'

pyflightstream.cases.workflows.ROW_KEY_MEANINGS module-attribute

ROW_KEY_MEANINGS: Mapping[str, InputKey] = MappingProxyType(
    {
        "FSI": InputKey(
            "Existing solid Euler-beam configuration resolved from inputs/fsi/.",
            "an f-prefixed code, such as f001",
            "",
            unscripted="Effective config.json and fsi-provenance.json are staged and hashed for the existing FSI driver.",
        ),
        **{
            key: InputKey(
                f"Dimensionless calibration of {property_name}; replaces the input-file factor once.",
                "finite positive number; omitted means use file factor or unity",
                "",
                unscripted="The effective FSI driver config and base/effective provenance carry the factor.",
            )
            for key, property_name in MATRIX_FACTORS.items()
        },
        START_REV_KEY: InputKey(
            "Revolutions of rigid wake development before the structural solver starts; replaces the input file's wake_development_revolutions for this row only.",
            "finite positive number of revolutions; omitted means use the file value",
            "",
            unscripted="The effective FSI driver config and its provenance carry the start, which governs when the deformation starts: the beam field is zero until then. Direct RIGID with the solver-frame compensation still writes the blade's rigid turn from call 1.",
        ),
        START_ITER_KEY: InputKey(
            "The first time step whose coupling call may deform the blade (a non-zero beam field); replaces the input file's wake_development_revolutions for this row only, through the row's DELTA_THETA (72 steps a revolution at 5 deg). Stated with FSI_START_REV it wins, with a warning.",
            "finite positive time step number; omitted means use FSI_START_REV or the file value",
            "",
            unscripted="The effective FSI driver config and its provenance carry the start, which governs when the deformation starts: the beam field is zero until then. Direct RIGID with the solver-frame compensation still writes the blade's rigid turn from call 1.",
        ),
        SIXDOF_VARIABLE: InputKey(
            "A body free to move under its loads, resolved from inputs/sixdof/ (FR-461): its families, body frame, mass, inertia, freedoms and forces.",
            "a d-prefixed code, such as d001",
            "CREATE_NEW_MOTION, SET_MOTION_MASS_PROPERTIES, SET_MOTION_6DOF_ACTIVE_VARIABLES, EXPORT_6DOF_TRAJECTORY",
        ),
        GEOMETRY_VARIABLE: InputKey(
            "The geometry the row opens, a file of inputs/geometries/; written in the GEOMETRY column.",
            "a file name with its extension",
            "OPEN, IMPORT",
        ),
        MESH_ROUTE_VARIABLE: InputKey(
            "How a row whose geometry is a generated configuration or an IGES file becomes a mesh the solver opens; an optional VAR_NAMES_VALUES key. Stated on a row with an FSM, OBJ or STL it is warned and skipped.",
            "native, full_grid or quad_dominant; NA or an omitted key leaves the row as it is",
        ),
        GEOM_CONFIGURATION_VARIABLE: InputKey(
            "The entry of the configuration registry a .geom.toml row builds; required when the file declares more than one.",
            "a configuration name of the file",
        ),
        GEOM_VARIANT_VARIABLE: InputKey(
            "The variant of the configuration a .geom.toml row builds; clean when absent.",
            "clean, or any variant the file declares",
        ),
        GEOM_PARAMS_VARIABLE: InputKey(
            "Parameter overrides of a .geom.toml row, a brace list of component.key=value pairs; a name the file does not hold refuses that row.",
            "{WING.planform.aspect_ratio=8, WING.planform.taper=0.6}",
        ),
        MESH_CONTROLS_VARIABLE: InputKey(
            "The mesh controls of the row's quad_dominant or full_grid route, a file of inputs/geometries/; <stem>.mesh.toml of the geometry when absent.",
            "a file name with its extension",
        ),
        SYMMETRY_VARIABLE: InputKey(
            "The symmetry the solver is initialized under, which states what was meshed; written in the SYMMETRY column.",
            "NONE, MIRROR or PERIODIC, as the build's database spells them; absent is NONE",
            "INITIALIZE_SOLVER",
        ),
        SYMMETRY_LOADS_VARIABLE: InputKey(
            "Whether the reported loads are the meshed sector's or the whole wheel's; written in its column, the one route to the command (the setup key is refused).",
            "true or false",
            "SET_ANALYSIS_SYMMETRY_LOADS",
        ),
        ALPHA_VARIABLE: InputKey(
            "The angle of attack, stated in the FLIGHT_CONDITION cell as a number or as the word sweep.",
            "deg",
            "SOLVER_SET_AOA",
        ),
        BETA_VARIABLE: InputKey(
            "The sideslip angle, stated in the FLIGHT_CONDITION cell as a number or as the word sweep.",
            "deg",
            "SOLVER_SET_SIDESLIP",
        ),
        IGNORE_MISSING_FAMILIES_VARIABLE: InputKey(
            "Whether a family the opened mesh lacks is left out or refuses the point; set by --ignore-missing-families of the command line and refused in a cell.",
            "true or false; the command line's default is true",
        ),
        EXPORT_LOG_VARIABLE: InputKey(
            "Whether the script exports the solver log; written by the run from the HPC profile's [log] table, never by a cell.",
            "false, the only value ever written",
            "EXPORT_LOG",
        ),
        PERIODIC_COPIES_VARIABLE: InputKey(
            "How many periodic copies the meshed sector stands for; required with SYMMETRY PERIODIC and refused otherwise.",
            "a count",
            "INITIALIZE_SOLVER",
        ),
        BASE_REGIONS_VARIABLE: InputKey(
            "The boundaries that become base regions, the flat base and never the body carrying it; a per-row choice beside the boundaries file's [base_regions.<family>].",
            "boundary names, comma separated",
            "DETECT_BASE_REGIONS_BY_SURFACE",
        ),
        ROTATE_VARIABLE: InputKey(
            "Rotations of the opened mesh, one record each, applied in the order written and after every translation.",
            "records {ANGLE: deg / AXIS: <frame>-<X|Y|Z> / ALIAS: <alias>}, with AUX_FRAMES optional",
            "ROTATE_SURFACE, SURFACE_ROTATE",
        ),
        TRANSLATE_VARIABLE: InputKey(
            "Translations of the opened mesh, one record each along one axis of a frame, applied in the order written and before every rotation.",
            "records {DISTANCE: m / AXIS: <frame>-<X|Y|Z> / ALIAS: <alias>}, with AUX_FRAMES optional",
            "TRANSLATE_SURFACE_IN_FRAME",
        ),
        VELOCITY_VARIABLE: InputKey(
            "The free-stream velocity of a case written in Python; a matrix row's comes from its FLIGHT_CONDITION.",
            "m/s",
            "SOLVER_SET_VELOCITY",
        ),
        ADVANCE_RATIO_VARIABLE: InputKey(
            "The rotor speed as an advance ratio, J = V / (n D) with D the rotor's diameter; stated in the FLIGHT_CONDITION cell or in a MOTIONS record, and written in the point's name.",
            "dimensionless",
        ),
        **{
            key: InputKey(
                f"The {axis} rate of the aircraft about the {axis} axis of the REF's [body_axes], {sense}; stated in the FLIGHT_CONDITION cell, it turns the free stream.",
                "deg/s",
                "SET_FREESTREAM",
            )
            for key, axis, sense in (
                (
                    "roll_rate",
                    "roll",
                    "positive right wing down",
                ),
                ("pitch_rate", "pitch", "positive nose up"),
                ("yaw_rate", "yaw", "positive nose right"),
            )
        },
        LOG_OUTPUT_VARIABLE: InputKey(
            "Which of a case's OUTPUTS is the solver log; a case written in Python states it, and a matrix row is refused it.",
            "a 1-based position",
            "EXPORT_LOG",
        ),
        NCPUS_VARIABLE: InputKey(
            "The processor count: the solver's thread count and, on a cluster, the scheduler's ncpus; written in the NCPUS column.",
            "a count",
            "SET_MAX_PARALLEL_THREADS",
        ),
        WALLTIME_VARIABLE: InputKey(
            f"The wall clock the row asks for: the scheduler's limit on a cluster, and what the watchdog counts down on an unsteady row; written in its column. {WALLTIME_BEST} asks the package for the walltime of a grouped job.",
            f"a number and its unit, {WALLTIME_UNITS_GLOSS}, as 240m or 4h",
            unscripted="on an unsteady row, stating it registers the wall-clock actions, and the run writes the deadline into the program they run; on a cluster, the job asks the scheduler for it.",
        ),
        CONFIGURATION_VARIABLE: InputKey(
            "The user's own name for the configuration; it configures nothing, and reaches a comment of the script and the custom polar header.",
            "text",
        ),
        ACTUATOR_VARIABLE: InputKey(
            'The actuator disc the row loads: the name of a block of the row\'s REF that declares kind = "actuator"; a flat selection names one disc, and brace records name several discs in order.',
            "a block name",
            "CREATE_NEW_ACTUATOR",
        ),
        ACTUATOR_RPM_VARIABLE: InputKey(
            "The disc's speed, a magnitude: its hand is the block's rpm_sign. A row stating ADVANCE_RATIO and not this key turns the disc at n = V / (J D) with the disc's own diameter.",
            "rev/min",
            "SET_PROP_ACTUATOR_RPM",
        ),
        ACTUATOR_THRUST_VARIABLE: InputKey(
            "The disc's net thrust, which selects the elliptical model; its reference block declares thrust_units (NEWTONS by default).",
            "NEWTONS, POUNDS or COEFFICIENT as declared in the actuator block",
            "SET_PROP_ACTUATOR_THRUST",
        ),
        PROFILE_VARIABLE: InputKey(
            "The profile file of the disc, which selects the custom model.",
            "the stem of a file of inputs/profiles/",
            "SET_PROP_ACTUATOR_PROFILE",
        ),
        FREESTREAM_UNITS_VARIABLE: InputKey(
            "Declare the custom file's dimensions explicitly. SI means global coordinates in m and velocities in m/s; a separate solver copy is converted once to measured native units. NATIVE preserves file bytes. Neither rotates the field.",
            "SI or NATIVE; omission preserves legacy bytes without inferring units",
            "SET_FREESTREAM",
        ),
        CCS_SHEDDING_VARIABLE: InputKey(
            "Refused in matrix runs; set the CCS shedding direction during geometry preparation.",
            "AXIAL or AZIMUTH during preparation",
            "",
        ),
        MORPHING_VARIABLE: InputKey(
            "Refused in matrix runs; prepare the deflected geometry before running its saved .fsm.",
            "geometry preparation only",
            "",
        ),
        MORPHING_ANGLE_VARIABLE: InputKey(
            "Refused in matrix runs; prepare the deflected geometry before running its saved .fsm.",
            "geometry preparation only",
            "",
        ),
        FREESTREAM_VARIABLE: InputKey(
            "A custom free stream in place of the uniform one: a velocity field over the YZ plane of the global frame, with units declared by FREESTREAM_UNITS, read when built. The field is the flow's direction (SOLVER_SET_AOA does not turn it, T14 on 26.124), so it is refused beside a non-zero ALPHA or BETA, as beside a non-zero or swept body rate and on a LEGACY row.",
            "the stem of a file of inputs/freestreams/, whose extension is its form: a .txt is the STRUCTURED form (a first line 'Npts Mpts', then the rows), a .dat the UNSTRUCTURED form (rows 'x y z vx vy vz' only)",
            "SET_FREESTREAM",
        ),
        ADDITIONAL_PPROC_VARIABLE: InputKey(
            "A second pproc the row names for the additional post; on 26.124 only, and refused on a LEGACY row.",
            "one pproc id, p<id>",
            unscripted="no builder reads it, so the row runs byte for byte as it would without it; pyfs-matrix post --additional-pproc reads it, reopens each recorded point's final .fsm with no solve and extracts that pproc from it.",
        ),
        COLD_START_VARIABLE: InputKey(
            "Starts each point of a steady sweep over the attitude from a cleared solution instead of the previous point's converged one. An unsteady row refuses it, since every point of it is its own job and starts cold; a steady row sweeping the flow, where every point is also its own job, starts every point cold whatever it states.",
            "true or false; absent is cold, false explicitly opts into warm starts",
            "CLEAR_SOLUTION",
        ),
        DELTA_TIME_VARIABLE: InputKey(
            "The physical time step of the run.",
            "s",
            "SET_SOLVER_UNSTEADY",
        ),
        TIME_ITERATIONS_VARIABLE: InputKey(
            "The number of physical time steps of the run.",
            "a count",
            "SET_SOLVER_UNSTEADY",
        ),
        J_CLOCK_VARIABLE: InputKey(
            "The notional advance ratio of a no-turning unsteady row's clock, against the reference's top-level rotor_diameter_m. With DELTA_THETA and REVOLUTIONS, sets the time step as (DELTA_THETA / 360) * J_CLOCK * D / V. Refused beside ADVANCE_RATIO, RPM or DELTA_TIME, and on a turning row; skipped on a steady row.",
            "positive, dimensionless",
            "SET_SOLVER_UNSTEADY",
        ),
        DELTA_THETA_VARIABLE: InputKey(
            "The rotor's rotation per time step, from which the time step follows at the rotor's speed.",
            "deg",
            "SET_SOLVER_UNSTEADY",
        ),
        REVOLUTIONS_VARIABLE: InputKey(
            "The total revolutions of the run, from which, with DELTA_THETA, the number of time steps follows.",
            "revolutions",
            "SET_SOLVER_UNSTEADY",
        ),
        LAST_ITERS_AVG_VARIABLE: InputKey(
            "The averaging window of a row that turns no rotor: the last time steps every unsteady product is averaged over.",
            "time steps",
            unscripted="the post stage averages the products over it.",
        ),
        BLADES_VARIABLE: InputKey(
            "The blade count of the row's reductions, where no rotor block of the reference states it. It sets the passage window of per-step exports and the post stage's per-blade reductions.",
            "a count",
            "SET_NEW_UNSTEADY_SOLVER_ACTION",
        ),
        EXPORT_UNSTEADY_AFTER_ITER_VARIABLE: InputKey(
            "The time step from which the per-step exports begin, each file stamped with its iteration.",
            "a time step",
            unscripted="stating it registers the per-step actions, and the run writes the step into the program they run.",
        ),
        EXPORT_UNSTEADY_LAST_ITER_VARIABLE: InputKey(
            "The last time steps of the run the per-step exports cover; the first exported step is TIME_ITERATIONS - K + 1.",
            "a time step count",
            unscripted="stating it registers the per-step actions, and the run writes the first step into the program they run.",
        ),
        RESTART_VARIABLE: InputKey(
            "How to continue a run that stopped on the wall clock.",
            "{FINISH_PENDING}, {ADDITIONAL_ITERS=<n>} or {ADDITIONAL_REVS=<n>}",
        ),
        LAST_REVS_AVG_VARIABLE: InputKey(
            "The averaging window of a rotor row: the last revolutions every unsteady product is averaged over.",
            "revolutions, a float",
            unscripted="the post stage averages the products over it.",
        ),
        CLOCK_MOTION_VARIABLE: InputKey(
            "The motion that owns the row's clock: the time step and the run length are that motion's.",
            "a motion the row states",
        ),
        RPM_VARIABLE: InputKey(
            "The rotor speed; stated in the FLIGHT_CONDITION cell, it reaches every motion that states none. On unsteady rows with rotor blocks it turns only each RMRP frame, signed by that block's rpm_sign; absent RPM leaves it fixed.",
            "rev/min",
            "SET_MOTION_ROTOR_RPM",
        ),
        RPM_SIGN_VARIABLE: InputKey(
            "The hand of a speed derived from ADVANCE_RATIO; refused beside an explicit RPM, and a rotor block's rpm_sign wins over it.",
            "1 or -1; absent is 1",
            "SET_MOTION_ROTOR_RPM",
        ),
        ROTOR_AXIS_VARIABLE: InputKey(
            "The axis the rotor of a flat row turns about; a rotor block of the reference states its own, and a row naming its rotor by MOVING_BC_ALIAS refuses this key.",
            "X, Y or Z",
            "SET_MOTION_ROTOR_AXIS",
        ),
        ROTOR_ORIGIN_VARIABLE: InputKey(
            "The hub of the rotor of a flat row; a rotor block of the reference states its own, and a row naming its rotor by MOVING_BC_ALIAS refuses this key.",
            "three coordinates, comma separated, or a rotor point of inputs/reference_points.toml",
            "CREATE_NEW_COORDINATE_SYSTEM",
        ),
        ROTOR_SHEDDING_VARIABLE: InputKey(
            "The direction the relaxed trailing edges of a rotor case shed their wake. Refused on every build, since no workflow command applies it. CCS_SHEDDING instead controls the shedding digit on the CCS file-import route, not general rotor wake direction. The Python helper rotor_relaxed_trailing_edges still sets it in the component definition's specifications.",
            "AXIAL or AZIMUTH; any value is refused on the matrix route",
        ),
        MOVING_BOUNDARIES_VARIABLE: InputKey(
            "The boundaries a flat rotor row turns; a MOTIONS record names its rotor by MOVING_BC_ALIAS instead, and a row stating an alias refuses this key.",
            "family names, or an alias",
            "SET_MOTION_BOUNDARIES",
        ),
        MOTIONS_VARIABLE: InputKey(
            "The rotor motions of the row, one record each, every rotor named by the alias of a rotor block of the reference; on an unsteady row, a record naming a TABLE of inputs/motions/ moves the boundaries of its ALIAS by that table.",
            "records {MOVING_BC_ALIAS: <alias> / RPM: rev/min}, or ADVANCE_RATIO in place of RPM; or {ALIAS: <alias> / TABLE: <file> / TABLE_TYPE: POSITION-TIME or VELOCITY-TIME}",
            "CREATE_NEW_MOTION",
        ),
        EXPORT_UNSTEADY_AFTER_REV_VARIABLE: InputKey(
            "The revolution of the rotor clock from which the per-step exports begin.",
            "revolutions",
            unscripted="stating it registers the per-step actions, and the run writes the step it falls on into the program they run.",
        ),
        EXPORT_UNSTEADY_LAST_REV_VARIABLE: InputKey(
            "The last revolutions of the rotor clock the per-step exports cover, taken up to the next whole time step.",
            "revolutions",
            unscripted="stating it registers the per-step actions, and the run writes the first step into the program they run.",
        ),
        RUN_WAKE_LENGTH_R_VARIABLE: InputKey(
            "The run length as the wake length the run should reach, in rotor radii: TIME_ITERATIONS = ceil(L R Omega / (V_ax dtheta)), with V_ax the free stream or the induced velocity of the setup's stated thrust, as wake_termination_length converts; stated with DELTA_THETA or DELTA_TIME, in place of REVOLUTIONS and TIME_ITERATIONS. A nominal length, not a measured wake.",
            "rotor radii",
            "SET_SOLVER_UNSTEADY",
        ),
        PASSAGE_POSITIONS_VARIABLE: InputKey(
            "How many clockings of a quasi-steady wheel are solved inside one blade passage, at theta_i = i * (360 / N) / k, and averaged by the post; required where the inflow varies around the disc (a custom inflow, an angle of attack or of sideslip), refused on a periodic sector. 2 converges thrust and torque to about 0.2 per cent, 6 or more the in-plane loads (RPT-089).",
            "a whole number, one or more",
            "ROTATE_SURFACE",
        ),
        RAW_VARIABLE: InputKey(
            "Solver command lines the row states verbatim, one record each or a file of them, each emitted before the phase it names.",
            "records {COMMAND: <line> / BEFORE: <phase>}, or FILE: <path> in place of COMMAND",
            accepted="every run type, and a LEGACY row",
        ),
        IDENTIFIERS_VARIABLE: InputKey(
            "Columns of every table the post writes for this row's polar, holding each value as text. Nothing of the run reads them: stating, changing or removing one launches nothing and leaves the plan current. On a simulation already posted they are written by pyfs-matrix post --sims <sim>.",
            "{NAME:value,NAME:value}; a comma ends a pair, so neither holds one",
            accepted="every run type, and a LEGACY row",
        ),
        **_acoustics.ACOUSTIC_KEY_MEANINGS,
    }
)

pyflightstream.cases.workflows.RPM_SIGN_VARIABLE module-attribute

RPM_SIGN_VARIABLE = 'RPM_SIGN'

pyflightstream.cases.workflows.RPM_VARIABLE module-attribute

RPM_VARIABLE = 'RPM'

pyflightstream.cases.workflows.RUN_WAKE_LENGTH_R_VARIABLE module-attribute

RUN_WAKE_LENGTH_R_VARIABLE = 'RUN_WAKE_LENGTH_R'

pyflightstream.cases.workflows.ReductionPlan dataclass

ReductionPlan(
    window: ExportWindow,
    revolution_steps: int,
    period_steps: int,
    blades: int,
    series_file: str,
    artefacts: tuple[str, ...],
)

Which windows the four reductions of one unsteady case are taken over.

It is a PLAN and not a driver, and the difference is the layer rule rather than a preference: post sits ABOVE run and cases, so nothing here may import the reader or the average. The reduction itself is :func:pyflightstream.post.unsteady.blade_passage_average, the only implementation of that average in the package, and the writing seam is :mod:pyflightstream.post.reductions. This object says WHICH windows to hand them, which is a fact of the CASE and not of the export.

Attributes:

Name Type Description
window ExportWindow

The export window, which is ALSO the averaging window. One window, not two: two windows a user has to keep consistent is a defect generator.

revolution_steps int

Solver steps in one whole revolution.

period_steps int

Solver steps in one blade passage, being one revolution divided by the blade count.

blades int

Blade count of the rotor.

series_file str

The raw time series, which is written FIRST and ships beside every reduction.

artefacts tuple of str

The four file names, the raw series first.

window_steps

window_steps() -> tuple[int, int]

Return the time-average window, which is the export window.

blade_windows

blade_windows() -> list[tuple[int, int]]

One window per blade, over the LAST complete revolution.

Contiguous and inclusive, ending at the last solver step of the run. These are disjoint passage windows: different blades sample different parts of the history. Their means mix temporal variation with blade differences. This public helper is retained for callers requesting that quantity; the campaign's per_blade product instead averages every blade over one shared window of its rotor.

pyflightstream.cases.workflows.RotorMach dataclass

RotorMach(
    alias: str,
    rpm: float | None,
    diameter_m: float | None,
    velocity_m_per_s: float | None,
    sonic_velocity_m_per_s: float | None,
    tip: float | None,
    helical: float | None,
    note: str | None = None,
    kind: str = "rotor",
    advancing: float | None = None,
    axis_resolved: bool = False,
)

The tip and helical Mach numbers of one rotor or disc at one point, or why not.

Attributes:

Name Type Description
alias str

The rotor, by the reference's alias (ROTOR for a row that turns a rotor its reference does not declare), or the actuator disc, by the name of its reference block.

rpm float or None

The speed in rev/min, signed by the hand, as the run turns it; a disc's is its block's rpm_sign times the speed, the opposite of the speed its script hands the solver (FR-331).

diameter_m float or None

The diameter the numbers were taken at: a rotor block's diameter_m, else the reference's rotor_diameter_m; a disc's twice its tip_radius_m.

velocity_m_per_s, sonic_velocity_m_per_s float or None

The free-stream speed and the speed of sound of the point's resolved flight condition.

tip, helical float or None

M_tip and M_hel (:func:rotor_mach_numbers); None where note says why they are not known.

advancing float or None

M_adv (:func:advancing_tip_mach_number, FR-1201); None where tip is.

axis_resolved bool

False where advancing is the edgewise bound (Omega R + V) / a because the row's rotor axis could not be resolved.

note str or None

Why the two numbers are not known, naming the row; None where they are.

kind str

"rotor" or "actuator": which of the two the numbers are of.

record

record() -> dict[str, object]

Return the JSON-ready entry the plan and the run record carry.

pyflightstream.cases.workflows.RotorSpeed dataclass

RotorSpeed(
    sim_id: str,
    stated_form: str,
    stated_value: float,
    rpm: float,
    advance_ratio: float | None,
    velocity_m_per_s: float | None,
    diameter_m: float | None,
)

The rotor speed of one case, and which form the row stated.

Attributes:

Name Type Description
sim_id str

The case this speed was resolved from. It exists so that a speed HANDED to another function can be checked against the case that function was given: without it, a speed resolved from a different row produces a clock and a rotor motion that are internally consistent, export, and are wrong, and nothing anywhere could refuse it.

stated_form str

rpm, advance_ratio or j_clock: what the user wrote.

stated_value float

Their value, verbatim and unconverted.

rpm float

The rotor speed in rev/min, signed. Derived where the form is an advance ratio, and the stated value itself where it is not.

advance_ratio float or None

The ratio, where one was stated.

velocity_m_per_s, diameter_m float or None

The two quantities the derivation consumed; None where nothing was derived, so a record cannot claim inputs it never read.

record

record() -> dict[str, object]

Return the stated form, the derived one, and every input consumed.

A no-turning J_CLOCK row retains this in its reduction record so the run block can report the reference clock against its own diameter.

pyflightstream.cases.workflows.SIMULATION_LENGTH_UNIT module-attribute

SIMULATION_LENGTH_UNIT = 'METER'

pyflightstream.cases.workflows.SIMULATION_SUFFIX module-attribute

SIMULATION_SUFFIX = '.fsm'

pyflightstream.cases.workflows.SONIC_HELICAL_MACH module-attribute

SONIC_HELICAL_MACH = 1.0

pyflightstream.cases.workflows.STEADY_RUN_TYPES module-attribute

STEADY_RUN_TYPES: tuple[str, ...] = (
    "steady",
    QSTEADY_ROTOR,
)

pyflightstream.cases.workflows.SYMMETRY_VARIABLE module-attribute

SYMMETRY_VARIABLE = 'SYMMETRY'

pyflightstream.cases.workflows.TIME_ITERATIONS_VARIABLE module-attribute

TIME_ITERATIONS_VARIABLE = 'TIME_ITERATIONS'

pyflightstream.cases.workflows.TimeStepping dataclass

TimeStepping(
    stated_form: str,
    delta_time_s: float,
    time_iterations: int,
    delta_theta_deg: float | None,
    revolutions: float | None,
    rpm: float | None,
    run_wake: RunWakeLength | None = None,
)

The physical clock of an unsteady run, and which form set it.

Attributes:

Name Type Description
stated_form str

angular (DELTA_THETA and REVOLUTIONS), explicit (DELTA_TIME and TIME_ITERATIONS) or run_wake_length (RUN_WAKE_LENGTH_R with DELTA_THETA or DELTA_TIME, FR-422).

delta_time_s float

Solver physical time step in s.

time_iterations int

Physical time steps of the whole run.

delta_theta_deg, revolutions float or None

The stated pair, where the form was angular.

rpm float or None

The rotor speed the conversion ran against.

run_wake RunWakeLength or None

Where the row states RUN_WAKE_LENGTH_R (FR-422), the target wake length and what resolved time_iterations from it; None otherwise.

steps_per_revolution property

steps_per_revolution: float | None

Solver steps in one revolution, or None without a turning rotor.

FROM THE AZIMUTHAL STEP WHERE THE CLOCK WAS STATED THAT WAY, and from the seconds only where it was not. A revolution is 360 degrees, so a ten-degree step is thirty-six steps exactly; deriving it from the seconds instead reads the rounding of the emitted step back as physics: 60 / (473.1723 * 0.00352) is 36.0238 for a run that resolves 36, once the step took the reference tooling's five decimals.

record

record() -> dict[str, object]

Return the stated form and every form derived from it.

This defines the record shape. No package consumer uses it, and the run record does not carry these rotor decisions.

rpm IS INCLUDED although it is an input rather than a derived form. steps_per_revolution below is computed FROM it, so a record carrying the quotient and not the divisor would show a reader a number they could not recover the working for. The paired :meth:RotorSpeed.record states the same rule as its reason for carrying every input it consumed.

pyflightstream.cases.workflows.UNSTEADY_ACTION_COUNT module-attribute

UNSTEADY_ACTION_COUNT = "actions/pfs_unsteady_actions.count"

pyflightstream.cases.workflows.UNSTEADY_ACTION_PROGRAM module-attribute

UNSTEADY_ACTION_PROGRAM = 'actions/pfs_unsteady_actions.py'

pyflightstream.cases.workflows.UNSTEADY_ACTION_SCRIPT module-attribute

UNSTEADY_ACTION_SCRIPT = 'actions/pfs_unsteady_exports.txt'

pyflightstream.cases.workflows.UNSTEADY_COUNTER_ACTION module-attribute

UNSTEADY_COUNTER_ACTION = 'pfs_unsteady_counter'

pyflightstream.cases.workflows.UNSTEADY_EXPORTS_ACTION module-attribute

UNSTEADY_EXPORTS_ACTION = 'pfs_unsteady_exports'

pyflightstream.cases.workflows.UnsteadyExportThreshold dataclass

UnsteadyExportThreshold(
    stated_form: str,
    stated_value: float,
    first_step: int,
    time_iterations: int,
    delta_time_s: float,
    step_deg: float | None,
    rpm: float | None,
    exports: str,
    step_offset: int = 0,
    farfield_windows: tuple[tuple[int, int, str], ...] = (),
)

The step the per-step exports begin on, and what they export.

Attributes:

Name Type Description
stated_form str

revolutions, iterations, last_revolutions or last_iterations: the key the row wrote.

stated_value float

The value it wrote.

first_step int

The first time step whose export runs: the step at which the invocation count reaches the threshold. EXPORT_UNSTEADY_AFTER_ITER: 4 exports at steps 4 to the end; one revolution at ten degrees a step exports from step 36.

time_iterations int

Physical time steps of the whole run.

delta_time_s float

Solver physical time step in s, written into the program so it can state the physical time of each count.

step_deg float or None

Degrees of rotor azimuth per time step, None on a run whose clock has no rotor behind it.

rpm float or None

The rotor speed the azimuth is counted against, None likewise.

exports str

The child script text the file carries from first_step on.

program_form property

program_form: str

Return the form the counter program compares in.

A last form counts back from the end of the run, which the program cannot know, so it compares the invocation count against the resolved first step: the program of EXPORT_UNSTEADY_LAST_REV is that of EXPORT_UNSTEADY_AFTER_ITER with the same first step (FR-872).

program_value property

program_value: float

Return the threshold the counter program compares against, in its own form.

record

record() -> ExportThresholdRecord

Return the stated form and the derived step, for a reader of the run.

pyflightstream.cases.workflows.VELOCITY_VARIABLE module-attribute

VELOCITY_VARIABLE = 'VELOCITY'

pyflightstream.cases.workflows.VERIFIED_ONLY_COMMANDS module-attribute

VERIFIED_ONLY_COMMANDS: frozenset[str] = frozenset(
    {"SOLVER_TIME_AVERAGING"}
)

pyflightstream.cases.workflows.WALLTIME_VARIABLE module-attribute

WALLTIME_VARIABLE = 'WALLTIME'

pyflightstream.cases.workflows.WHOLE_RUN_EXPORT_KINDS module-attribute

WHOLE_RUN_EXPORT_KINDS: tuple[str, ...] = (
    "simulation",
    "plots",
    "log",
)

pyflightstream.cases.workflows.WORKFLOWS module-attribute

WORKFLOWS: dict[str, Workflow] = {}

pyflightstream.cases.workflows.WORKFLOW_KEY module-attribute

WORKFLOW_KEY = 'matrix_workflow'

pyflightstream.cases.workflows.Workflow dataclass

Workflow(
    name: str,
    summary: str,
    commands: tuple[str, ...],
    builder: Callable[
        [SimCase, Script, WorkflowConventions], None
    ],
    keys: tuple[str, ...],
)

One run type, and everything needed to judge it before it runs.

Attributes:

Name Type Description
name str

The name a WORKFLOW cell writes.

summary str

One sentence, in plain language, saying what the type is FOR.

commands tuple of str

Every command the builder ALWAYS emits, whatever the case says. This is what :func:covered_builds derives coverage from, so a command that is only sometimes emitted must NOT be listed: listing it would narrow the range for runs that never reach it.

builder callable

builder(case, script, conventions) -> None.

keys tuple of str

Every VAR_NAMES_VALUES key the run type READS: the row's vocabulary, and the list a refusal prints when a row states a key outside it (PFS-2008.02.01: a row states only what the script will carry). A key here is one the builder, the clock, the window or the point name resolves; a key another run type reads is refused on this one naming that type, because a value nothing reads would change nothing about the run while reading as though it had. The tier-3 workspace is the control that the tuple is complete: every matrix there plans READY, so a key a row of it states is registered here.

pyflightstream.cases.workflows.WorkflowConventions dataclass

WorkflowConventions(
    outputs: tuple[str, ...] = (),
    animation_folder: str = "frames",
)

What the run layer tells a workflow about the workspace.

workspace sits ABOVE cases, so a workflow can never reach the naming template that rendered these names; they arrive as data or they do not arrive at all.

Attributes:

Name Type Description
outputs tuple of str

Output file names for the point being built, relative to the execution directory, already rendered by the workspace. A workflow exports these and never a literal, which is what keeps two points of one case from overwriting each other.

animation_folder str

Accepted and has no effect: no workflow writes animation frames into it. A value other than the default "frames" warns that it is ignored.

for_case classmethod

for_case(case: SimCase) -> WorkflowConventions

Fall back to the names the case itself carries.

Used when no caller passed conventions in. The campaign loop renders :attr:SimCase.outputs for the point before the builder runs, so this is the same information one layer earlier.

pyflightstream.cases.workflows.WorkflowCoverageError

Bases: PyflightstreamError, RuntimeError

A workflow was asked for a solver build it does not cover.

Raised BEFORE the first emission and before any executor is constructed, so nothing is spent and no half-built script exists (PFS-2025.18). The message names the build received, the builds the workflow covers in release order, and the commands whose absence forced the range.

RuntimeError is the standard-library base rather than ValueError, because this refusal is about the ENVIRONMENT the script would run in and not about an argument the caller passed: every argument may be perfectly well formed and the answer still be that this build cannot run this study.

There is deliberately NO override route. The escape already exists one level up, in :meth:pyflightstream.script.Script.allow_broken, which is a recorded waiver naming a reason; a second, quieter one here would be a way past the guard that leaves no record.

pyflightstream.cases.workflows.accepted_symmetry

accepted_symmetry(script: Script) -> tuple[str, ...] | None

Return the symmetry modes one build's INITIALIZE_SOLVER accepts.

READ FROM THE COMMAND DATABASE, per build, and never a literal list kept here. The modes are a per-version fact of the command's own grammar, so a list in this module would be a second declaration of a vocabulary this package already stores with its evidence, free to drift the moment a build states a different set.

The database is reached through :attr:Script.registry, which is public for exactly this reason: everything recording a per-version fact ABOUT a script has to ask the same database the script itself validates against.

Parameters:

Name Type Description Default
script Script

The script under construction, bound to one build.

required

Returns:

Type Description
tuple of str or None

The accepted tokens, in the order the database declares them. None where that build's INITIALIZE_SOLVER declares no argument called symmetry at all, which is a real case and not a failure: FlightStream 25.000 spells it SYMMETRY_TYPE with its own token set (FSM-25.000 p.298). None is what sends a row on to :func:pyflightstream.script.helpers.initialize_solver, whose refusal already names that edition and its remedy.

An EMPTY TUPLE where the build declares a symmetry argument that is NOT an enumeration. A non-enum argument carries no values in the command database and reads back as (). No registered build is that shape today: 25.000 spells the argument symmetry_type and every other build declares the three-token enum.

BOTH FALSY ANSWERS MEAN "THIS BUILD CANNOT JUDGE A MODE", so a caller tests truthiness::

if accepted and mode not in accepted:
    ...

That is what the built-in workflows do, and they deliberately do NOT tell the two apart. Tell them apart only when REPORTING to a user which fact holds: None means the build declares no argument of that name, () means it declares one that is not an enumeration. An earlier draft of this paragraph pointed at the workflow builders as the precedent for distinguishing them, which is the opposite of what they do, and a reader following that citation found a truthiness test and could reasonably conclude is not None was sanctioned. It is not.

AN ENUMERATION DECLARING NO TOKENS IS NOT ONE OF THESE CASES, and the distinction is worth a line because the obvious reading gets it backwards. That state cannot exist: :class:pyflightstream.commands.ArgSpec refuses to validate an enum with no values, so a database containing one fails to load. An earlier draft of this section offered it as the meaning of () and called the real producer impossible, which is exactly the reading under which if accepted is not None looks correct at the call site. It is not, and that regression was written and reverted once already.

Raises:

Type Description
CommandNotInVersionError

When the build's command view carries no INITIALIZE_SOLVER at all. Unreachable from the builders, which call :func:require_coverage first, and reachable by a caller passing a :class:~pyflightstream.script.Script bound to a build that only the registry knows.

pyflightstream.cases.workflows.additional_outputs

additional_outputs(
    pproc: PprocSpec, *, stem: str, unsteady: bool
) -> tuple[str, ...]

Return the files one extraction writes, relative to its own folder (G12).

The loads table always; the surface exports the additional pproc's [exports] selects, by the rule :func:~pyflightstream.cases.default_outputs applies (Tecplot unless it says false, VTK and CSV where it says true), and the VTK a Tecplot is written from wherever the Tecplot is (G45); the surface sections and the sectional loads ALWAYS, because the reopened file stores the sections and not their loads, so the extraction computes them every time (RPT-062); the plots history on an unsteady point, which the file keeps; and the solver log unless [exports] turns it off. Never a saved simulation and never probe points: the extraction saves nothing and samples no probe points; the traces of the artifact's streamlines, surface and off the body, are its one tracing.

Parameters:

Name Type Description Default
pproc PprocSpec

The additional pproc artifact.

required
stem str

The point's stem, which every name of the run's own exports carries.

required
unsteady bool

Whether the point's run type marches in time.

required

Returns:

Type Description
tuple of str

The file names, in the order :data:~pyflightstream.cases.EXPORT_KINDS exports them.

pyflightstream.cases.workflows.advancing_tip_mach_number

advancing_tip_mach_number(
    *,
    rpm: float,
    diameter_m: float,
    velocity_m_per_s: float,
    sonic_velocity_m_per_s: float,
    flow_direction: tuple[float, float, float]
    | None = None,
    axis: tuple[float, float, float] | None = None,
) -> tuple[float, bool]

Return a rotor's advancing-tip Mach number and whether its axis was used (FR-1201).

The sibling of :func:rotor_mach_numbers, in the same home::

M_adv = sqrt((Omega R + V_ip)^2 + V_ax^2) / a

with V_ax the free-stream component along the rotor axis and V_ip = |V - V_ax axis| the component in the rotor plane. It equals M_hel in axial flow and (Omega R + V) / a edgewise. Where the flow direction or the axis is not given (the row's rotor axis cannot be resolved), it is the edgewise bound (Omega R + V) / a, and the second value is False so the plan can say so.

Parameters:

Name Type Description Default
rpm float

As for :func:rotor_mach_numbers, with the same refusals.

required
diameter_m float

As for :func:rotor_mach_numbers, with the same refusals.

required
velocity_m_per_s float

As for :func:rotor_mach_numbers, with the same refusals.

required
sonic_velocity_m_per_s float

As for :func:rotor_mach_numbers, with the same refusals.

required
flow_direction tuple of float

The free stream's direction, any non-zero length, in the frame of axis (:func:free_stream_direction).

None
axis tuple of float

The rotor axis, any non-zero length, in the same frame.

None

Returns:

Type Description
tuple

(M_adv, axis_used).

Raises:

Type Description
CampaignConfigError

As :func:rotor_mach_numbers.

Examples:

>>> m_adv, used = advancing_tip_mach_number(
...     rpm=3000.0, diameter_m=2.0, velocity_m_per_s=100.0, sonic_velocity_m_per_s=340.0,
...     flow_direction=(1.0, 0.0, 0.0), axis=(0.0, 0.0, 1.0),
... )
>>> round(m_adv, 4), used
(1.2181, True)

pyflightstream.cases.workflows.blade_mesh_record

blade_mesh_record(
    case: SimCase, script: Script | None = None
) -> dict[str, Any] | None

Return how the mesh file holds a coupled rotor's blades, or None off that route (FR-3416).

For a coupled unsteady_rotor row, the facts :func:pyflightstream.cases.fsi_workspace.blade_mesh_frame resolves for the coupled rotor's blades: the import's metres per unit, the hub (where the row's built script placed the blade frames, which a flat row's ROTOR_ORIGIN moves, else the rotor's origin), whether the row moves the mesh, and each blade's name in the file. The run stages them in fsi-provenance.json (blade_mesh), where the post placement check reads them.

Parameters:

Name Type Description Default
case SimCase

The expanded matrix row.

required
script Script

The row's built script, whose blade frames locate the hub.

None

Returns:

Type Description
dict or None

The blade mesh record, or None off the coupled unsteady_rotor route.

pyflightstream.cases.workflows.build_additional_script

build_additional_script(
    case: SimCase,
    script: Script,
    *,
    saved: str,
    shadow: Script,
) -> None

Build the script that extracts an additional pproc from a point's saved simulation (G12).

WHAT IT EMITS, in this order, and nothing else: OPEN of the saved simulation with no initialisation argument, which the emitter follows with the blank line OPEN needs to stop reading its arguments (RPT-062: without it the next command was read as an argument and the launch exported nothing); the additional pproc's section distributions, in the frames the run created; the loads frame and the moments model the run set; the loads selections of a steady point's setup; UPDATE_ALL_SURFACE_SECTIONS and COMPUTE_SURFACE_SECTIONAL_LOADS, always, because the file stores the sections and not their loads; the exports :func:additional_outputs names; and CLOSE_FLIGHTSTREAM.

WHAT IT NEVER EMITS: START_SOLVER, INITIALIZE_SOLVER, SAVEAS, a frame, a probe or a plot. The saved simulation already holds the frames, the boundaries and the solved state; the setup's raw commands and custom flags are not replayed, because the saved state carries what they set.

Parameters:

Name Type Description Default
case SimCase

The point's case with pproc and pproc_id the ADDITIONAL artifact's and outputs from :func:additional_outputs.

required
script Script

An empty script bound to one of :data:ADDITIONAL_POST_BUILDS.

required
saved str

The path of the saved simulation to open, as the solver will read it.

required
shadow Script

The point's own run script built again (:func:frames_of_the_run), whose frames and boundary inventory the saved simulation holds.

required

Raises:

Type Description
CampaignConfigError

A build other than the one RPT-062 measured, an additional pproc asking what a reopened file does not give back, a shadow that created no frame map, or a distribution citing a frame the run did not create.

WorkflowCoverageError

An internal defect: the rendered text carries a command an extraction must never carry.

pyflightstream.cases.workflows.build_script

build_script(
    case: SimCase,
    script: Script,
    *,
    conventions: WorkflowConventions | None = None,
    registry: CommandRegistry | None = None,
) -> None

Build one case's whole script from the run type it names.

In order: select the workflow (refusing two builders or none), check that the script's build is covered (refusing BEFORE the first emission), then build.

Parameters:

Name Type Description Default
case SimCase

The case, with its sweep point already filled by the campaign loop.

required
script Script

An empty script bound to the campaign's FlightStream build.

required
conventions WorkflowConventions

What the run layer says about the workspace; defaults to the names the case carries.

None
registry CommandRegistry

Alternative command database, used by tests.

None

Raises:

Type Description
CampaignConfigError

If the case names two builders or none, or if a value the run type needs is absent or unparsable.

WorkflowCoverageError

If the script's build is outside the workflow's derived coverage.

Examples:

>>> from pyflightstream.cases import SimCase, SweepAxis
>>> from pyflightstream.script import Script
>>> case = SimCase(
...     sim_id="7002",
...     aircraft="RotorRig",
...     sweep=SweepAxis(type="alpha", values=[0.0]),
...     recipe="steady",
...     outputs=["loads_a+00.0.txt"],
...     variables={"VELOCITY": "30.0"},
...     point={"alpha": 0.0},
... )
>>> script = Script("26.120")
>>> build_script(case, script)
>>> script.render().splitlines()[0]
'SET_FREESTREAM CONSTANT'

pyflightstream.cases.workflows.carries_singularity_strength

carries_singularity_strength(case: SimCase) -> bool

Say whether the row's pproc asks its Tecplot surface to carry the strength (SS1).

singularity_strength = true in the pproc artifact the row names; absent, false, or no pproc at all, the script exports no native Tecplot and the translated surface declares Singularity_strength not carried.

Parameters:

Name Type Description Default
case SimCase

The row's case; only its pproc artifact is read.

required

Returns:

Type Description
bool

True when the pproc states singularity_strength = true; False when it states it false, omits it, or the case has no pproc.

pyflightstream.cases.workflows.command_accepted_on

command_accepted_on(
    entry: CommandEntry, version: FsVersion
) -> bool

Say whether a row may reach a command on a build: the rule the builders refuse by.

A command documented or verified on the build is one a script emits there; a command of :data:VERIFIED_ONLY_COMMANDS must be verified there. A build with no record of the command, or one recording it broken or removed, accepts it under neither rule.

Parameters:

Name Type Description Default
entry CommandEntry

The command's database entry.

required
version FsVersion

The build, whose record is read with hotfix inheritance.

required

Returns:

Type Description
bool

True where a row reaching the command is not refused for its status.

Examples:

>>> from pyflightstream.commands import CommandRegistry
>>> from pyflightstream.versions import resolve
>>> command_accepted_on(CommandRegistry.load().commands["SOLVER_SET_AOA"], resolve("26.120"))
True

pyflightstream.cases.workflows.coupled_blade_frame

coupled_blade_frame(
    case: SimCase,
) -> tuple[str, dict[str, Any]]

Return blade one's name in the mesh file and how the file holds it (PFS-2185.11).

Blade one of the rotor the FSI row couples, as :func:blade_mesh_record resolves it with no script: its sections are cut from the row's mesh about the rotor's origin.

Parameters:

Name Type Description Default
case SimCase

The matrix row as bound so far, its geometry and its import stated.

required

Returns:

Type Description
tuple of (str, dict)

The blade's name in the mesh file, and the :func:blade_mesh_frame facts.

Raises:

Type Description
CampaignConfigError

If the row couples no one resolved rotor, or the rotor names no blade.

pyflightstream.cases.workflows.covered_builds

covered_builds(
    workflow: Workflow,
    *,
    registry: CommandRegistry | None = None,
) -> tuple[str, ...]

Return the solver builds a workflow covers, DERIVED from the database.

A build is covered when its command view carries every command the workflow always emits, or the build's own documented vocabulary for that command's job (:data:_SUBSTITUTES, which the builder writes on that build). Nothing is declared: a build registered tomorrow joins this tuple the moment its evidence lands, and a command whose status moves narrows it in the same commit.

Parameters:

Name Type Description Default
workflow Workflow

The run type.

required
registry CommandRegistry

Alternative database, used by tests; defaults to the packaged one.

None

Returns:

Type Description
tuple of str

Canonical identifiers, in RELEASE order, which is the order of commands/_meta.yaml and the only ordering authority (CONTRIBUTING.md invariant 4).

pyflightstream.cases.workflows.creates_surface_sections

creates_surface_sections(text: str) -> bool

Say whether a rendered script adds or removes a surface section.

A script for which this is False changed no section, so the empty list is its whole section layout: the sections of its export, if any, are the ones the opened file carried. The run records that layout, and the post reads it off the recorded script of a record written before the run did. A line is read as a command by its first word, as the script renders one, and a # comment is not a command.

Parameters:

Name Type Description Default
text str

A rendered script.

required

Returns:

Type Description
bool

True when any line is NEW_SURFACE_SECTION_DISTRIBUTION, CREATE_NEW_SURFACE_SECTION, DELETE_SURFACE_SECTION or DELETE_ALL_SURFACE_SECTIONS, whichever route wrote it.

Examples:

>>> creates_surface_sections("START_SOLVER\nEXPORT_ALL_SURFACE_SECTIONS\nA_cp.txt\n")
False
>>> creates_surface_sections("# NEW_SURFACE_SECTION_DISTRIBUTION\nSTART_SOLVER\n")
False
>>> creates_surface_sections("NEW_SURFACE_SECTION_DISTRIBUTION\nFRAME 2\n")
True

pyflightstream.cases.workflows.disc_speed_moves_with_the_point

disc_speed_moves_with_the_point(case: SimCase) -> bool

Return whether the row's disc turns at a different speed at each point.

True when the row names a disc, states no ACTUATOR_RPM and no row-level ADVANCE_RATIO, and its points carry more than one advance ratio: each point's speed is then its own n = V / (J D). The steady run type reads this to run such a row one job per point, because a warm job sets the disc once and every point after the first would turn at the first point's speed.

Parameters:

Name Type Description Default
case SimCase

The row, before it is split into points.

required

Returns:

Type Description
bool

True when the disc speed differs between the points of the sweep.

pyflightstream.cases.workflows.effective_fsi_config

effective_fsi_config(
    case: SimCase, *, version: str | FsVersion | None = None
) -> FsiConfig | None

Return the structural configuration a point's run stages as its config.json.

The row's FSI input as resolved, except on a qsteady_rotor sector, whose structure turns at the speed the row turns the free stream: there omega_rad_per_s is the row's (:func:pyflightstream.cases.fsi_workspace.quasi_steady_fsi_config), so the structural solve applies the centrifugal loads at that speed. The builder and the run read this one function, so the nodes the script imports and the configuration the structural program loads describe one structure.

With version, the build the run's script is written for, the solver-frame compensation is staged off where it does not apply (:func:frame_compensation_skip_reason, FR-3415), so the structural program writes the field uncompensated; the plan warned of it.

Parameters:

Name Type Description Default
case SimCase

The point's case; its FSI input and run type are read.

required
version str or FsVersion

The build the run stages for; None stages the compensation as the input states it.

None

Returns:

Type Description
FsiConfig or None

None for a row with no FSI.

pyflightstream.cases.workflows.emit_rotor_motion

emit_rotor_motion(
    case: SimCase,
    script: Script,
    *,
    frame: int | str,
    moving_frames: Sequence[int | str] | str | None = "all",
    speed: RotorSpeed | None = None,
) -> int | None

Emit one rotary motion entirely from what the row declares.

Motion, its type, its coordinate system, its rotor axis, its rotor speed and its moving boundaries, with nothing hand-written between the matrix cell and the command.

THE VOCABULARY FOLLOWS THE BUILD, and it is decided in one place: :func:pyflightstream.script.helpers.rotary_motion writes a ROTARY motion with its axis and speed where the build documents them, and a EUCLIDEAN motion with the speed as an angular velocity plus the rotor mark where script.rotor_vocabulary.euclidean_rotor holds (measured on 26.000 by RPT-049), and the angular velocity in rev/min with no mark where script.rotor_vocabulary.unmarked_euclidean_rotor holds (26.100, RPT-051). Coverage counts both substitutes through _carried, so the workflow writes them on 25.100, 26.000 and 26.100. :func:require_coverage refuses 25.000, which has the whole Euclidean rotor and no CREATE_NEW_MOTION, before this runs.

Parameters:

Name Type Description Default
case SimCase

The case; its variables carry the rotor speed in rev/min (RPM), the rotor axis within frame (ROTOR_AXIS, one of X, Y, Z) and optionally the moving boundaries (MOVING_BOUNDARIES, comma-separated boundary NAMES, family names, or 1-based positions; absent means every boundary). A family name is a boundary label with its trailing number removed, so Blade selects every blade the opened geometry carries and one cell is right for a sector mesh and a full wheel alike. Positions still work and warn: they belong to one file's boundary order and name different surfaces in a file that orders them differently. Names resolve only where the geometry was opened by this package, which is what declares the inventory. A matrix row stating ROTOR_SHEDDING is refused before this function runs (:func:_refuse_rotor_shedding, called by every builder and by :func:build_script). Called directly on a case that bypassed that refusal, this function still reads the key and emits nothing for it; see :func:rotor_shedding_direction for why.

required
script Script

Script under construction. Nothing is emitted into it until every value has been read and converted, so a refusal leaves it exactly as it was.

required
frame int or str

Local coordinate system of the rotation, by index or by its creation label; it must exist earlier in the script.

required
moving_frames sequence, ``"all"`` or None

Local frames attached to the motion; "all" is the default.

'all'
speed RotorSpeed

The already-resolved rotor speed of THIS case; resolved here when not given, which is what every caller outside the builders does.

None

Returns:

Type Description
int or None

Identifier of the created motion, for later citations. None when every declared family is absent and the motion is left out.

Raises:

Type Description
CampaignConfigError

If the row declares no rotor speed or no rotor axis, declares one that is not a number, or declares a ROTOR_SHEDDING direction that is neither of the two. The message names the case (whose sim_id IS the matrix POL) and the KEY.

pyflightstream.cases.workflows.export_window

export_window(
    *,
    degrees: float | None = None,
    steps: int | None = None,
    revolutions: float | None = None,
    rpm: float | None = None,
    delta_time_s: float | None = None,
    delta_theta_deg: float | None = None,
    time_iterations: int,
) -> ExportWindow

Build one :class:ExportWindow, keeping the stated form verbatim.

Parameters:

Name Type Description Default
degrees float

The window, in EXACTLY ONE of the three forms. Degrees are degrees of rotor rotation; steps are solver physical time steps; revolutions are whole turns.

None
steps float

The window, in EXACTLY ONE of the three forms. Degrees are degrees of rotor rotation; steps are solver physical time steps; revolutions are whole turns.

None
revolutions float

The window, in EXACTLY ONE of the three forms. Degrees are degrees of rotor rotation; steps are solver physical time steps; revolutions are whole turns.

None
rpm float

Rotor speed in rev/min the degrees are counted on. Required for the degrees and revolutions forms.

None
delta_time_s float

Solver physical time step in s. Required for the degrees and revolutions forms.

None
time_iterations int

Physical time steps of the whole run. The window ends here and is clipped to the available history when it is longer.

required
delta_theta_deg float

Rotor rotation per solver physical time step in degrees, used to convert between the angular forms and steps.

None

Returns:

Type Description
ExportWindow

The window, with the stated form kept verbatim and the others computed beside it.

Raises:

Type Description
CampaignConfigError

If two forms or none are given; if an angular form is given with no rotor speed or no time step, naming the physical cause; or if the run or the resolved window contains no time steps.

pyflightstream.cases.workflows.frame_compensation_skip_reason

frame_compensation_skip_reason(
    case: SimCase, version: str | FsVersion
) -> str | None

Return why the row's requested solver-frame compensation is skipped, or None (FR-3415).

The facts :func:pyflightstream.cases.fsi_workspace.frame_compensation_skip judges, read from the case: its workflow, and on unsteady_rotor the coupled rotor's signed speed.

Parameters:

Name Type Description Default
case SimCase

The expanded matrix row.

required
version str or FsVersion

The solver version the row runs on.

required

Returns:

Type Description
str or None

The reason the compensation is skipped, or None when the row does not request it or it applies.

pyflightstream.cases.workflows.frame_definitions

frame_definitions(
    text: str, *, registry: CommandRegistry | None = None
) -> tuple[tuple[str, ...], ...]

Return every command of a rendered script that defines or moves a frame, with its lines.

One entry per command of the database whose name says it is about a coordinate system, in order: the ones that create, place, edit, turn, translate, rename, normalise, copy, mirror or delete a frame, and the ones that assign it (the set the frame ledger of :class:~pyflightstream.script.Script classifies command by command). Each entry is the command's line and every line after it up to a blank line, a comment or the next command of the database, stripped: an EDIT_COORDINATE_SYSTEM carries its FRAME, NAME, origin and three axis vectors, a ROTATE_COORDINATE_SYSTEM its frame, axis and angle.

It is how a saved simulation's frames are compared with the frames a script built today would create (G12): two scripts whose definitions agree created the same frames at the same indices, with the same names, in the same place and orientation, and moved them alike afterwards. Index and name alone take a frame turned since the run under its old name for the one it was.

Parameters:

Name Type Description Default
text str

A rendered script.

required
registry CommandRegistry

The command database whose names end a command's lines; the committed one by default.

None

Returns:

Type Description
tuple of tuple of str

One tuple of lines per frame command, the command's own line first.

pyflightstream.cases.workflows.frames_of_the_run

frames_of_the_run(
    case: SimCase,
    version: str | FsVersion,
    *,
    registry: CommandRegistry | None = None,
) -> Script

Build a point's own run script again, for what it says about the saved simulation.

The script is never written or run. Its :attr:~pyflightstream.script.Script.frames_by_name, num_local_frames, boundary_inventory and section_blocks describe the frames, the boundaries and the distributions the point's saved simulation holds, PROVIDED the run's recorded script created the same frames: the caller compares the two scripts' :func:frame_definitions before trusting it, because the row may have been edited since the run.

A continuation creates no frame of its own, so a case stating RESTART is built without it and its two resolved facts: the script is then the one the chain's first run built, whose frames the saved state carries. The run already said every warning the build raises, so none is raised again.

Parameters:

Name Type Description Default
case SimCase

The point's case, as the run built it: its point, its outputs and its staged geometry.

required
version str or FsVersion

The build the run's script was emitted under.

required
registry CommandRegistry

Alternative command database, used by tests.

None

Returns:

Type Description
Script

The built script.

pyflightstream.cases.workflows.free_stream_direction_at

free_stream_direction_at(
    alpha_deg: float, beta_deg: float
) -> tuple[float, float, float]

Return the unit free-stream vector for an incidence and sideslip in degrees.

Parameters:

Name Type Description Default
alpha_deg float

Incidence angle in degrees.

required
beta_deg float

Sideslip angle in degrees.

required

Returns:

Type Description
tuple[float, float, float]

Unit free-stream vector in reference axes.

pyflightstream.cases.workflows.march_strategy

march_strategy(
    case: SimCase,
    *,
    capabilities: BuildCapabilities,
    registry: CommandRegistry | None = None,
) -> MarchStrategy | None

Decide how an unsteady case is marched on a build, or refuse it by name.

THE ONE SEAM. :func:build_script calls it once, after the coverage check and before the first emission; the plan and the run record carry what it returns.

Parameters:

Name Type Description Default
case SimCase

The case about to build.

required
capabilities BuildCapabilities

The target build's capabilities.

required
registry CommandRegistry

Alternative database, used by tests to name the builds with actions.

None

Returns:

Type Description
MarchStrategy or None

None for a case that is not unsteady; MARCH_ACTIONS when the row states a per-step threshold or a wall clock, or its pproc a [time_averaging] window (G25), and the build has the actions they need; MARCH_SINGLE otherwise. A continuation marks no action of its own: it is MARCH_SINGLE unless it also states one of those.

Raises:

Type Description
BuildCapabilityError

If the build documents no per-step action and the row asks for a per-step threshold, a wall clock, or a continuation that reads their records (RESTART: {FINISH_PENDING} or {ADDITIONAL_REVS=n}).

Examples:

>>> from pyflightstream.cases import SimCase, SweepAxis
>>> case = SimCase(
...     sim_id="7003",
...     aircraft="Wing",
...     sweep=SweepAxis(type="alpha", values=[0.0]),
...     recipe="unsteady",
...     variables={"VELOCITY": "30.0", "DELTA_TIME": "0.01", "TIME_ITERATIONS": "4"},
... )
>>> march_strategy(case, capabilities=BuildCapabilities.for_build("26.120"))
'single_march'

pyflightstream.cases.workflows.normal_probe_creation

normal_probe_creation(
    case: SimCase,
    version: str,
    *,
    conventions: WorkflowConventions | None = None,
) -> str

Return the conventional probe creation needed at far-field window start.

Only sets needed by an avg_window far-field entry are created here. Final-only and default declared entries remain after the march. The commands are validated on an in-memory script with the full row's placement.

Parameters:

Name Type Description Default
case SimCase

The bound row, continued or not.

required
version str

The FlightStream build the script is written for.

required
conventions WorkflowConventions

The rendered output names; defaults to the case's own.

None

Returns:

Type Description
str

The lines, each ending in a newline; empty when no far-field window requires conventional points.

Raises:

Type Description
CampaignConfigError

If the row cannot be built from its mesh, naming the entries and the remedy.

pyflightstream.cases.workflows.phase_locked_gate

phase_locked_gate(
    spec: PhaseLockedSpec | None, *, revolutions: float
) -> dict[str, object] | None

Return the SKIP a short run's phase-locked reduction carries, or None.

Item 9. Apply PhaseLockedSpec.generated_for to the revolutions the row actually turns before generating a phase-locked reduction.

THE RULE HAS TWO HALVES and the second is the one a wiring gets wrong: if the matrix row reaches the minimum number of revolutions, the phase-locked reduction is generated; and falling short of that minimum does not refuse the polar, it only skips the phase-locked reduction. A short run is SKIPPED WITH A REASON and never refused -- losing a polar because a rotor did not turn long enough is taking a product away from a campaign that already happened.

A pproc saying nothing about phase_locked receives a phase-locked reduction without a declared minimum-revolution gate.

Parameters:

Name Type Description Default
spec PhaseLockedSpec or None

The pproc's phase-locked specification; None when it states none.

required
revolutions float

The revolutions the matrix row turns.

required

Returns:

Type Description
dict of str to object or None

None when the reduction is generated (no spec, or the minimum is reached); otherwise the SKIP entry, with its reason, that a short run carries.

pyflightstream.cases.workflows.qsteady_case_kind

qsteady_case_kind(case: SimCase) -> str

Return which quasi-steady case a qsteady_rotor row is: "sector" or "wheel".

THE ROW'S SYMMETRY DECIDES, because it states what was meshed. PERIODIC is a sector, one blade standing for the wheel, solved once, steady, in a free stream turning at the rotor's speed. No symmetry (NONE, or none stated) is the wheel, every blade meshed.

Raises:

Type Description
CampaignConfigError

If the symmetry is MIRROR, or any other: a rotor turning about its shaft is not its own mirror image, so a mirrored rotor is neither case.

Parameters:

Name Type Description Default
case SimCase

The qsteady_rotor row's case; its symmetry variable is read.

required

Returns:

Type Description
str

"sector" for PERIODIC, "wheel" for NONE or no symmetry.

pyflightstream.cases.workflows.qsteady_inflow_fft

qsteady_inflow_fft(
    case: SimCase,
) -> dict[str, object] | None

Return the harmonic content of a quasi-steady wheel's custom inflow (plan --inflow-fft).

For each station of blade one (the chord read off the mesh, as :func:qsteady_validity reads it; else equal bands from 0.2 of the tip radius to the tip, and no k_eff), the angle-of-attack perturbation ONE BLADE meets over one revolution in the row's custom inflow, with the rotation composed, and its harmonic order n95 (:func:pyflightstream.cases.qsteady.blade_inflow_harmonics); k_eff = n95 k_1P per station; n_max, the highest n95; and the suggested PASSAGE_POSITIONS >= n_max / N + 1 beside the row's own.

nP IS COUNTED ON THE BLADE: how many times one blade meets the perturbation per revolution. It is not the blade-passing N P a fixed surface near the rotor feels, nor what a balance under the whole rotor measures (only the multiples of N P survive in the rotor's total, which is why the clockings are read against n_max / N).

NEVER RAISES for a row the builder would refuse: a point that is not a quasi-steady wheel with a custom inflow returns None, and a field that cannot be read returns a record whose note says why.

Parameters:

Name Type Description Default
case SimCase

The point's case; it must be a qsteady_rotor wheel in a custom inflow for a record to be produced.

required

Returns:

Type Description
dict of str to object or None

The harmonic record (per-station n95 and k_eff, n_max, the suggested PASSAGE_POSITIONS and a note); None for a point that is not a quasi-steady wheel with a custom inflow.

pyflightstream.cases.workflows.qsteady_inflow_map_inputs

qsteady_inflow_map_inputs(
    case: SimCase,
) -> dict[str, object] | None

Resolve SI inputs for an inflow map from a workspace point.

Parameters:

Name Type Description Default
case SimCase

Resolved point, including its geometry and custom freestream.

required

Returns:

Type Description
dict[str, object] or None

Map inputs at the point's speed, or None without a sampled inflow.

Raises:

Type Description
CampaignConfigError

If the rotor is stopped (RPM 0): a map has no advance ratio to be built at.

pyflightstream.cases.workflows.qsteady_validity

qsteady_validity(
    case: SimCase, *, inflow_fft: bool = False
) -> dict[str, object] | None

Return the 1P reduced frequency of a quasi-steady wheel point, as the plan shows it.

With inflow_fft (pyfs-matrix plan --inflow-fft), a wheel point in a custom inflow also carries, under inflow_fft, the harmonic content of that inflow as one blade meets it (:func:qsteady_inflow_fft).

Parameters:

Name Type Description Default
case SimCase

The point's case.

required
inflow_fft bool

Add the harmonic content of the custom inflow under inflow_fft. Defaults to False.

False

Returns:

Type Description
dict of str to object or None

The 1P reduced-frequency record, with inflow_fft added where asked and available; None for a point that carries no such record.

pyflightstream.cases.workflows.read_actuator_profile

read_actuator_profile(path: str | PathLike[str]) -> str

Read a radial thrust profile file into the text the solver is given (G06).

The user's file stays as its editor saved it; the run writes its own copy for the solver, and this is that copy's text: the file's rows put in the one form 26.124 was measured to read by :func:pyflightstream.script.helpers.render_actuator_profile, two numbers r,F per line with NO final newline (RPT-070). A final newline, blank lines, CR LF line ends, surrounding spaces and a byte-order mark are removed rather than refused.

One reader for both places that ask: the plan, when a row's PROFILE is resolved, and every builder that emits the disc, so a case built in Python is held to the same form.

Parameters:

Name Type Description Default
path str or path - like

The profile file, where it lives.

required

Returns:

Type Description
str

The copy's text, newline separated and not newline terminated.

Raises:

Type Description
CampaignConfigError

The file cannot be read as UTF-8 text, or is not in the form the solver reads, naming the file and the line: a header or a count first, a row that is not two numbers separated by one comma, a number that is not finite, fewer than two rows.

pyflightstream.cases.workflows.reduction_plan

reduction_plan(case: SimCase) -> ReductionPlan

Build the reduction plan of one unsteady rotor case.

Parameters:

Name Type Description Default
case SimCase

The case; its variables carry BLADES beside the window keys :meth:ExportWindow.from_case reads.

required

Returns:

Type Description
ReductionPlan

Raises:

Type Description
CampaignConfigError

If the row declares no blade count, or a window shorter than one blade passage.

pyflightstream.cases.workflows.reduction_windows

reduction_windows(
    case: SimCase,
) -> dict[str, object] | None

Resolve the windows of every applicable reduction off one row, for its record.

The window is LAST_REVS_AVG or LAST_ITERS_AVG from the row. Removed WINDOW_* keys are refused. Where an older row states neither, a rotor row states DELTA_THETA and REVOLUTIONS (or a speed and the seconds), so a revolution in steps is known and the LAST revolution is the window; a rotorless row states DELTA_TIME and TIME_ITERATIONS and nothing shorter, so the whole run is. Every window is counted in solver steps, inclusive and 1-based, and ends at the run's last step.

Which reductions apply is the run type's: unsteady_rotor carries all three, unsteady the time average alone, because a blade passage has no length without a rotor, and a steady row carries no history at all and gets None. Within a rotor row a reduction the row cannot window is recorded as skipped with the reason, never guessed: no BLADES means no passage length; a run shorter than one revolution has no last revolution to split by blade.

Unresolvable clocks are recorded as skipped reductions with their reason. Removed row keys are refused before any window is derived.

Parameters:

Name Type Description Default
case SimCase

The case, as the run stage holds it when it writes the record.

required

Returns:

Type Description
dict or None

None for a run type with no time history. Otherwise a JSON-ready mapping: time_iterations, steps_per_revolution (None without a rotor speed), blades (None where unstated), and one entry per applicable reduction, each either {"windows": [[first, last], ...], "window_from": <how the window was stated>} (the two passage reductions add period_steps) or {"skipped": <reason>}.

A row that NAMES ITS ROTORS by alias also carries rotors (:data:ROTORS_KEY), alias to that rotor's block: its blades, its rpm, its own steps_per_revolution and period_steps, and its phase_locked and per_blade in the same two shapes (FR-68). On such a row the FLAT passage keys carry a skip naming that block, because one blade passage of the ROW has no length when two rotors turn at two speeds; the time average stays one window of the whole point. A rotor whose motion could not be resolved is a block carrying a skip rather than an absence, so a rotor is never lost from the record. A row stating no motion carries no rotors at all and is exactly what it was.

Examples:

>>> from pyflightstream.cases import SimCase, SweepAxis
>>> case = SimCase(
...     sim_id="7001", aircraft="RotorRig", recipe="unsteady_rotor",
...     sweep=SweepAxis(type="alpha", values=[0.0]),
...     variables={"VELOCITY": "30", "RPM": "1200", "BLADES": "4",
...                "DELTA_TIME": "0.0001", "TIME_ITERATIONS": "720",
...                "LAST_REVS_AVG": "0.25"},
... )
>>> plan = reduction_windows(case)
>>> plan["time_average"]["windows"], plan["per_blade"]["period_steps"]
([[596, 720]], 125)
>>> plan["per_blade"]["windows"][-1]
[596, 720]

pyflightstream.cases.workflows.refuse_an_additional_post_build

refuse_an_additional_post_build(
    version: str | FsVersion, *, where: str
) -> None

Refuse the additional post on a build RPT-062 did not measure it on.

Parameters:

Name Type Description Default
version str or FsVersion

The build the row's script is emitted under.

required
where str

What names the row or the case, for the message.

required

Raises:

Type Description
CampaignConfigError

When version is not one of :data:ADDITIONAL_POST_BUILDS.

pyflightstream.cases.workflows.refuse_an_untranslatable_surface

refuse_an_untranslatable_surface(
    case: SimCase, script: Script
) -> None

Refuse a script whose Tecplot surface cannot be written from its VTK (G45).

The solver writes the VTK in the analysis loads frame (RPT-074), so the Tecplot is written from it by undoing that frame, which the package can do only where this script placed it: a frame an opened project carries, or one a command moved in a way the frame ledger does not follow, has no placement. A frame whose axes are not orthonormal is refused too, and so is a vtk_variables naming some of VX, VY, VZ and not all three where the loads frame is not the reference frame, since the solver writes each component from all three. Called at the end of every build, so a refusal costs no seat; a continuation is not asked, because its loads frame is the saved simulation's and the run takes it from the run it continues.

Parameters:

Name Type Description Default
case SimCase

The point's case; its pproc vtk_variables are read.

required
script Script

The script just built; its recorded surface translations are checked.

required

Returns:

Type Description
None

Returns normally when every translation can be undone.

Raises:

Type Description
CampaignConfigError

Naming the case, the Tecplot output and the frame.

pyflightstream.cases.workflows.refuse_what_a_saved_point_cannot_give

refuse_what_a_saved_point_cannot_give(
    pproc: PprocSpec, *, pproc_id: str, where: str
) -> None

Refuse an additional pproc that asks what a reopened simulation does not give back.

RPT-062 measured it on 26.124: a point's saved simulation, opened again with no solve, gives back the total loads, the surface solution, every surface section and the sectional loads computed on it, a distribution defined after reopening included, and on an unsteady point its plots history. It does not give back the field off the body: probe points updated or created after reopening differ from the run's. So an additional pproc declares section distributions, chooses among the surface exports and states its post-processing tables, and every table asking for something else is refused HERE, at plan, before a seat is spent:

  • [[probes]] and [volume_section], the field off the body (RPT-062);
  • [plots] and [time_averaging], which fill during a march, and the additional post runs none;
  • an [exports] turning the sections or the sectional loads off, which the additional post always computes and exports, or turning on a kind it never writes: the probe points, the per-panel force distribution, the solver's plots.

Parameters:

Name Type Description Default
pproc PprocSpec

The additional pproc artifact, as the workspace resolved it.

required
pproc_id str

Its id, for the message.

required
where str

What names the row, for the message: matrix row POL 3207.

required

Raises:

Type Description
CampaignConfigError

Naming every refused table of the artifact in one message.

pyflightstream.cases.workflows.require_coverage

require_coverage(
    workflow: Workflow,
    version: str | FsVersion,
    *,
    registry: CommandRegistry | None = None,
) -> None

Refuse a build the workflow does not cover, before anything is emitted.

Parameters:

Name Type Description Default
workflow Workflow

The run type about to build.

required
version str or FsVersion

The target FlightStream build.

required
registry CommandRegistry

Alternative database, used by tests.

None

Raises:

Type Description
WorkflowCoverageError

If the build's command database does not carry every command the workflow always emits. The message names the build, the covered range in release order, and the commands that forced it.

pyflightstream.cases.workflows.resolve_workflow

resolve_workflow(name: str) -> Workflow

Look one workflow up in the table.

Parameters:

Name Type Description Default
name str

The workflow type, as a WORKFLOW cell writes it.

required

Returns:

Type Description
Workflow

The registered workflow.

Raises:

Type Description
CampaignConfigError

If no workflow of that name is registered. The refusal lists what IS registered, because a workflow cannot be supplied from outside: an unknown name is always a typo or a version gap, and never a module the caller forgot to install.

pyflightstream.cases.workflows.rotor_mach_numbers

rotor_mach_numbers(
    *,
    rpm: float,
    diameter_m: float,
    velocity_m_per_s: float,
    sonic_velocity_m_per_s: float,
) -> tuple[float, float]

Return a rotor's tip and helical Mach numbers, (M_tip, M_hel).

The one home of both definitions; the plan, the run record and the rotor table all call it::

Omega = 2 pi RPM / 60            (rad/s)
M_tip = Omega R / a
M_hel = sqrt(V^2 + (Omega R)^2) / a

with R half the rotor diameter, V the free-stream speed and a the speed of sound of the point's resolved flight condition.

Parameters:

Name Type Description Default
rpm float

The rotor speed in rev/min. Its sign is the hand of the rotation and is not read: both numbers are of the tip SPEED.

required
diameter_m float

The rotor diameter in m, greater than zero.

required
velocity_m_per_s float

The free-stream speed in m/s, zero or more.

required
sonic_velocity_m_per_s float

The speed of sound in m/s, greater than zero.

required

Returns:

Type Description
tuple of float

(M_tip, M_hel).

Raises:

Type Description
CampaignConfigError

A diameter or a speed of sound that is not a positive finite number, or a free-stream speed or rotor speed that is not finite.

Examples:

>>> tip, helical = rotor_mach_numbers(
...     rpm=3000.0, diameter_m=2.0, velocity_m_per_s=100.0, sonic_velocity_m_per_s=340.0
... )
>>> round(tip, 4), round(helical, 4)
(0.924, 0.9697)

pyflightstream.cases.workflows.rotor_machs

rotor_machs(case: SimCase) -> list[RotorMach]

Return the tip and helical Mach numbers of every rotor and disc a row turns.

Three row types carry them (M1): every unsteady_rotor and qsteady_rotor row, every steady row that states RPM, and every row, of any run type, that names an actuator disc (ACTUATOR). Each rotor and each disc is one :class:RotorMach.

The case is the point's (:func:pyflightstream.cases.case_at_point), so the free-stream speed and the speed of sound are that point's resolved flight condition, the velocity a static rig derives from its advance ratio and speed included; at V = 0 the helical number is the tip's. A rotor's speed is the one the run turns (:func:rotor_speed, per motion record where the row states MOTIONS) and its diameter the rotor block's, else the reference's rotor_diameter_m. A disc's speed is the one its builder resolves, ACTUATOR_RPM or the speed its advance ratio works out to against the disc's own diameter, and its diameter is twice its tip_radius_m.

NEVER RAISES for a row the builder would refuse: a quantity that cannot be resolved is a :class:RotorMach whose note names the row and what is missing, because an addition by the package may not refuse a run. A rotor with no known diameter is said so, never guessed.

Parameters:

Name Type Description Default
case SimCase

The point's case, with its flight condition resolved.

required

Returns:

Type Description
list of RotorMach

One per rotor, then one per disc; empty for a row of none of the three types.

pyflightstream.cases.workflows.rotor_relaxed_trailing_edges

rotor_relaxed_trailing_edges(
    case: SimCase, specifications: Sequence[str]
) -> list[str]

Restate a rotor case's relaxed trailing edges in the row's direction.

From Python, a case whose variables carry ROTOR_SHEDDING: AZIMUTH is passed here with the specifications its component definition carries, and they come back with the direction value set. A MATRIX ROW stating ROTOR_SHEDDING is refused because no workflow command applies it. CCS_SHEDDING controls the shedding digit on the separate CCS file-import route, not general rotor wake direction. This helper writes no component file, so the rendered text is returned for the caller to write where their geometry keeps it.

Parameters:

Name Type Description Default
case SimCase

The case, whose ROTOR_SHEDDING variable carries the direction; see :func:rotor_shedding_direction.

required
specifications sequence of str

The relaxed trailing-edge specifications as the component definition carries them, three values or four (FSM-26.124 p.85).

required

Returns:

Type Description
list of str

One rendered specification per input, in the same order. A three-value specification comes back with three values where the row asks for nothing or for the axial direction, because those are what it already means; it gains the direction only where the row asks for the azimuth direction.

Raises:

Type Description
CampaignConfigError

If the row's direction is neither of the two, if a specification cannot be read, or if specifications is a single string or something that cannot be iterated. Every message names the case, and the unreadable-specification one names which of how many: a component definition carries one per trailing edge, so "one of them is malformed" is not an answer a reader can act on.

Examples:

>>> from pyflightstream.cases import SimCase, SweepAxis
>>> from pyflightstream.cases.workflows import rotor_relaxed_trailing_edges
>>> case = SimCase(
...     sim_id="7001",
...     aircraft="RotorRig",
...     sweep=SweepAxis(type="alpha", values=[0.0]),
...     recipe="unsteady_rotor",
...     variables={"ROTOR_SHEDDING": "AZIMUTH"},
... )
>>> rotor_relaxed_trailing_edges(case, ["0.5;0.1;0.9"])
['0.5;0.1;0.9;1']

pyflightstream.cases.workflows.rotor_shedding_direction

rotor_shedding_direction(case: SimCase) -> str | None

Return the relaxed-wake shedding direction this rotor row asks for.

The direction is a field of the relaxed trailing-edge COMPONENT specification and not a scripting argument (FSM-26.123 p.85), so no workflow emits it. This function parses the value for the Python helper :func:rotor_relaxed_trailing_edges, which applies it to the specifications a component definition carries. A matrix row stating ROTOR_SHEDDING is refused by every matrix workflow, since none applies it. CCS_SHEDDING controls the shedding digit on the CCS file-import route; it is not a general rotor wake-direction switch.

Parameters:

Name Type Description Default
case SimCase

The case; ROTOR_SHEDDING in its variables carries AXIAL or 0 for the axial direction, which is the default, and AZIMUTH or 1 for the azimuth direction, which 26.123 adds and which is the one a rotor case is likely to want.

required

Returns:

Type Description
str or None

"AXIAL", "AZIMUTH", or None where the row does not declare the key. None is the statement "this row asks nothing", and it is distinct from "AXIAL": a row asking for nothing leaves a three-value specification at three values, while a row asking for the axial direction states it on every specification that already states one.

Raises:

Type Description
CampaignConfigError

If the row declares a direction that is neither. The message names the case, the KEY, the value written and both accepted directions, on this module's own rule that a matrix value is refused by the cell the user typed rather than by the command.

Examples:

>>> from pyflightstream.cases import SimCase, SweepAxis
>>> from pyflightstream.cases.workflows import rotor_shedding_direction
>>> case = SimCase(
...     sim_id="7001",
...     aircraft="RotorRig",
...     sweep=SweepAxis(type="alpha", values=[0.0]),
...     recipe="unsteady_rotor",
...     variables={"ROTOR_SHEDDING": "azimuth"},
... )
>>> rotor_shedding_direction(case)
'AZIMUTH'

pyflightstream.cases.workflows.rotor_speed

rotor_speed(case: SimCase) -> RotorSpeed

Resolve the rotor speed a row states, in either form.

Parameters:

Name Type Description Default
case SimCase

The case. It states ADVANCE_RATIO or RPM, exactly one. The ratio form also reads RPM_SIGN (default 1), the case's free-stream velocity, and the rotor diameter carried on the case reference.

required

Returns:

Type Description
RotorSpeed

Raises:

Type Description
CampaignConfigError

If the row states both forms or neither, except the static-rig form, where the row's own cell states RPM and ADVANCE_RATIO and no velocity: the speed is taken and the ratio has already fixed the run's velocity. Also if a ratio is stated with no rotor diameter on the reference, naming the artifact field to add; or if the ratio, the velocity or the diameter is not a positive number.

pyflightstream.cases.workflows.rotor_time_stepping

rotor_time_stepping(
    case: SimCase, *, speed: RotorSpeed | None = None
) -> TimeStepping

Resolve the physical clock of an unsteady rotor run, in either form.

Parameters:

Name Type Description Default
case SimCase

The case. It states DELTA_THETA and REVOLUTIONS, or DELTA_TIME and TIME_ITERATIONS; one pair, not both and not half of one.

required
speed RotorSpeed

The already-resolved rotor speed of THIS case, so the caller that needs both resolves the ratio once. Resolved here when not given.

KEYWORD-ONLY, deliberately. Nothing here can check that a passed speed belongs to this case, so a speed resolved from another row would produce a clock that is internally consistent, exports, and is wrong. A keyword-only parameter cannot be supplied by accident from a positional call site, and the name at the call site is what makes the mistake visible in a diff.

None

Returns:

Type Description
TimeStepping

Raises:

Type Description
CampaignConfigError

If both pairs or neither are stated; if one pair is stated half; or if the revolutions and the azimuthal step do not work out to a WHOLE number of time steps, which is refused naming the two numbers and the nearest pair that does. A row stating RUN_WAKE_LENGTH_R is resolved, and refused, by :func:_run_wake_stepping (FR-422).

pyflightstream.cases.workflows.row_symmetry_loads

row_symmetry_loads(
    case: SimCase, from_setup: bool | None = None
) -> bool | None

Resolve the symmetry-loads flag: the ROW's when it states one (FR-66).

The row's SYMMETRY_LOADS column (PFS-2255) is the only route: the setup key is refused by name, so the package passes no from_setup and a row stating nothing emits nothing.

Whether the solver reports the loads of the meshed SECTOR or of the whole wheel is a per-row choice, because one preset serves a sector row and a full-wheel row. A row stating it OVERRIDES the preset and warns naming the case, both values and the one used; a row stating nothing inherits silently.

The first decision that hour was to refuse both stating it, as the rotor speed is refused; it was changed the same hour, and the warning is what keeps the override from being silent.

Parameters:

Name Type Description Default
case SimCase

The row's case; its symmetry-loads variable is read.

required
from_setup bool or None

The value the setup preset states, or None when it states none.

None

Returns:

Type Description
bool or None

The row's value when it states one, else from_setup.

Raises:

Type Description
CampaignConfigError

If the row states a value that is none of true, false, ENABLE or DISABLE.

Warns:

Type Description
PyflightstreamWarning

If the row's value differs from the preset's, naming both; the row wins.

pyflightstream.cases.workflows.select_workflow

select_workflow(case: SimCase) -> str

Return the workflow a case names, refusing two builders or none.

Parameters:

Name Type Description Default
case SimCase

The case, as converted from a matrix row or authored in campaign.toml.

required

Returns:

Type Description
str

The workflow name; :func:resolve_workflow turns it into the builder.

Raises:

Type Description
CampaignConfigError

If the case names BOTH a workflow and a user recipe, printing both values so the user can see which to delete; or if it names NEITHER, listing the types that exist.

pyflightstream.cases.workflows.sixdof_commands

sixdof_commands(spec: SixDofSpec) -> list[str]

Return the commands a 6DOF input emits, in order of first use.

Parameters:

Name Type Description Default
spec SixDofSpec

The input.

required

Returns:

Type Description
list of str

The command names.

pyflightstream.cases.workflows.streamline_commands

streamline_commands(
    spec: StreamlinesSpec, *, reopened: bool = False
) -> list[str]

Return the commands a [streamlines] table emits, in order of first use.

Parameters:

Name Type Description Default
spec StreamlinesSpec

The table.

required
reopened bool

Whether the script opens a saved simulation, which may carry streamlines to delete first.

False

Returns:

Type Description
list of str

The command names.

pyflightstream.cases.workflows.streamline_count

streamline_count(case: SimCase) -> int

Return the off-body streamlines one point of the case traces (FR-1079).

Parameters:

Name Type Description Default
case SimCase

The case; its pproc's [streamlines] table is read.

required

Returns:

Type Description
int

The sum of every line's count and every tube's radial * circular; 0 where the pproc traces none.

pyflightstream.cases.workflows.surface_time_averaging

surface_time_averaging(
    case: SimCase,
) -> SurfaceAverageWindow | None

Resolve the pproc's surface window on the same clock as LAST_REVS_AVG.

It is the window the PACKAGE averages the per-step surface exports over: its first step is where the per-step exports begin, and the post averages every step of it. None where the pproc states no [time_averaging].

Parameters:

Name Type Description Default
case SimCase

The row's case; its pproc [time_averaging] table and the run clock of its run type are read.

required

Returns:

Type Description
SurfaceAverageWindow or None

The window of steps the surface exports are averaged over; None when the pproc states no [time_averaging].

Raises:

Type Description
CampaignConfigError

If the run type is not an unsteady one; if the run has no valid clock; or if the stated window cannot be resolved on that clock (the resolver's message is carried, naming the case).

pyflightstream.cases.workflows.tecplot_source

tecplot_source(
    tecplot: str, kinds: Mapping[str, str]
) -> str

Return the VTK a point's Tecplot surface is written from (G45).

ONE VTK EXPORT PER POINT FEEDS BOTH: where the outputs name a VTK, the Tecplot is written from that very file; otherwise the script exports one under the Tecplot's own name with the .vtk extension.

Examples:

>>> tecplot_source("P1-AL+000.dat", {"tecplot": "P1-AL+000.dat"})
'P1-AL+000.vtk'
>>> tecplot_source("P1-AL+000.dat", {"tecplot": "P1-AL+000.dat", "vtk": "field.vtk"})
'field.vtk'

Parameters:

Name Type Description Default
tecplot str

The name of the native Tecplot output the point writes.

required
kinds Mapping of str to str

The point's outputs by kind, as classify_outputs returns them; its "vtk" entry, where present, is the VTK to use.

required

Returns:

Type Description
str

The declared VTK name, else the Tecplot's own name with the .vtk extension.

pyflightstream.cases.workflows.time_steps_of

time_steps_of(case: SimCase) -> int | None

Return the physical time steps one case asks for, or None for a steady row.

The cost table of FR-82 needs this for a point it is about to plan, and the fit behind it needs the same number for a point already RECORDED, so it is one function rather than two readings of one fact.

BOTH UNSTEADY RUN TYPES RESOLVE ONE. A rotor row states its azimuthal step and its revolutions rather than a count: DELTA_THETA 15 over REVOLUTIONS 1.5 is 36 steps, and :func:rotor_time_stepping is what turns the one into the other.

Parameters:

Name Type Description Default
case SimCase

The case, with its sweep point already filled: a row sweeping ADVANCE_RATIO states no rotor speed until the point supplies the value, and the clock of a rotor row is resolved against that speed.

required

Returns:

Type Description
int or None

The step count, or None for a steady row and for a row this reader cannot step. The second answers None rather than raising because the caller is a REPORT: a row the builder will refuse gets its refusal from the builder, with the builder's message, and a table meanwhile prints a blank instead of a number nobody can check.

pyflightstream.cases.workflows.unsteady_action_command_line

unsteady_action_command_line(
    interpreter: str = sys.executable,
) -> str

Return the shell line the COMMAND_LINE action runs: the interpreter, then the program.

Both quoted, because an interpreter path with a space in it is one argument. The interpreter is the one building the script, which is the one the run layer names when it writes the program, so the line the solver runs and the program it runs agree on which Python. On Windows, its pythonw.exe sibling, which must exist or the build is refused, prevents a console.

Parameters:

Name Type Description Default
interpreter str

The Python executable building the script; sys.executable by default. On Windows its pythonw.exe sibling is used and must exist; without it the build is refused.

executable

Returns:

Type Description
str

The interpreter and the action program, each in double quotes.

pyflightstream.cases.workflows.unsteady_counter_steps

unsteady_counter_steps(case: SimCase) -> int

Return the time steps an unsteady row's step counter counts to (FR-314).

The steps the point's script marches: a continuation's owed steps, else the clock of its run type, the same clock :func:unsteady_export_threshold reads. The run layer writes it into the count-only program, where the progress bar of a local run reads it (FR-129).

Parameters:

Name Type Description Default
case SimCase

The point's case; its run type and its continuation, if any, decide the clock that is read.

required

Returns:

Type Description
int

The number of physical time steps the point's unsteady script marches.

pyflightstream.cases.workflows.unsteady_export_threshold

unsteady_export_threshold(
    case: SimCase,
    conventions: WorkflowConventions | None = None,
    *,
    version: str | FsVersion,
) -> UnsteadyExportThreshold | None

Resolve the export threshold a row states, or None when it states none.

Called by the two unsteady builders before their first emission, so a refusal leaves the script as it was, and again by the run layer, which writes the program from it: it is a function of the case alone, so the two calls agree.

Parameters:

Name Type Description Default
case SimCase

The case; its variables may carry one of EXPORT_UNSTEADY_AFTER_REV, EXPORT_UNSTEADY_AFTER_ITER, EXPORT_UNSTEADY_LAST_REV or EXPORT_UNSTEADY_LAST_ITER.

required
conventions WorkflowConventions

The rendered output names; defaults to the case's own.

None
version str or FsVersion

The solver version whose conventions the resolved threshold follows: the case's build, required because the export lines are build-dependent and no literal build is right for every row.

required

Returns:

Type Description
UnsteadyExportThreshold or None

None when the row states none of the four keys. A last form resolves to the first step TIME_ITERATIONS - n + 1 (FR-415).

Raises:

Type Description
CampaignConfigError

If two keys are stated, naming them; if the row names the steady run type, which has no time loop; if the revolutions form is stated on the run type that turns nothing, naming the iterations form that would work; if the value is not a positive number; or if the threshold lies beyond the run, naming both numbers.

pyflightstream.cases.workflows.unsteady_time_stepping

unsteady_time_stepping(case: SimCase) -> TimeStepping

Resolve the physical clock of a run that turns nothing.

THE SECONDS AND THE COUNT, OR THE ANGULAR PAIR WITH A SPEED BESIDE IT. A degree of rotation has a duration only against a rotor speed, and this run type meshes nothing that turns, so the angular pair needs a stated speed, as for a wing-body in a rotor's slipstream, whose step is an azimuthal step of that rotor and whose row states its advance ratio. A row stating the pair and a speed is resolved exactly as the rotor type resolves it; a row stating the pair and no speed is refused, naming the two keys that would make it resolvable.

This resolver handles unsteady non-rotor rows independently of :func:rotor_time_stepping.

J_CLOCK states a notional speed against the top-level reference diameter, with DELTA_THETA and REVOLUTIONS. Its clock is independent of rotor blocks and CLOCK_MOTION, and its speed is retained for clock outputs and windows.

Parameters:

Name Type Description Default
case SimCase

The case; its variables carry DELTA_TIME in seconds and TIME_ITERATIONS as a step count.

required

Returns:

Type Description
TimeStepping

The resolved clock, in the explicit stated form, carrying no rotor speed because the run has none.

Raises:

Type Description
CampaignConfigError

If the row states the angular pair with no rotor speed to divide by, states neither pair, or states half of the explicit one. Each message names the case, which is the matrix POL, and the keys involved.

Notes

A POWER-OFF ROW RUNS ON ITS POWER-ON TWIN'S CLOCK (PFS-2184.10): where the reference declares a rotor and the row states its speed (:func:power_off_clock), the clock is that rotor's, resolved by :func:rotor_time_stepping exactly as the unsteady_rotor row with the same keys resolves it, so the step, the count, the revolution thresholds and the averaging windows of the two rows agree.

pyflightstream.cases.workflows.with_tecplot_source

with_tecplot_source(
    outputs: Sequence[str],
    *,
    singularity_strength: bool = False,
) -> list[str]

Include the sources of the translated surface in run output accounting.

The VTK supplies panel values and is always a source. The native Tecplot supplies nodal strength and is one only where singularity_strength says the row's pproc asks for it (SS1): a point is never incomplete for a native file it was never asked to write. The sources are waited for, filed and hashed, including at each exported step. Calling this on an already expanded output list is idempotent.

Parameters:

Name Type Description Default
outputs sequence of str

The output names the row declares.

required
singularity_strength bool

Whether the row's pproc asks the Tecplot surface to carry the singularity strength; when True the native Tecplot source is also added. Defaults to False.

False

Returns:

Type Description
list of str

The outputs with each missing source placed right after the Tecplot; the names unchanged when no Tecplot is declared.

pyflightstream.cases.workflows.workflow_names

workflow_names() -> tuple[str, ...]

Return the registered workflow names, sorted.

Returns:

Type Description
tuple of str

The names of every registered workflow, in alphabetical order.

pyflightstream.cases.workflows.workflow_registry

workflow_registry(
    *, conventions: WorkflowConventions | None = None
) -> dict[str, ScriptRecipe]

Return the workflows as a recipe registry the campaign loop can take.

This is the seam that makes a workflow reachable with NO user function: hand it to run_matrix(recipe_registry=...) and a row whose FS_SCRIPT code maps to a workflow NAME builds through the table instead of through an import.

Parameters:

Name Type Description Default
conventions WorkflowConventions

Passed down to every builder; the run layer owns these, since workspace sits above cases.

None

Returns:

Type Description
dict of str to callable

{name: build(case, script) -> None}, satisfying :class:pyflightstream.cases.ScriptRecipe.

Examples:

>>> from pyflightstream.cases.workflows import workflow_registry
>>> registry = workflow_registry()
>>> "steady" in registry
True
>>> registry["steady"].__name__
'workflow_steady'