Skip to content

pyflightstream.cases.farfield_inputs (provisional)

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

What each far-field analysis of a row needs, and whether it is reused, added or refused.

Pipeline role: the ONE resolver of the far-field inputs (FR-455), called by the plan and by post so the two cannot disagree. From the pproc artifact, the row's run type and its facts, it states for every selected analysis and every input one of four states: reused (the artifact declares it), added (the plan adds it), not_applicable (the analysis does not apply to the run type, FR-1059) or refused (it cannot be produced, FR-1049), each with its source and its reason. It reads nothing from disk and imports no layer above cases.

Advanced

pyflightstream.cases.farfield_inputs.FARFIELD_STATES module-attribute

FARFIELD_STATES: tuple[str, ...] = (
    "reused",
    "added",
    "not_applicable",
    "refused",
)

pyflightstream.cases.farfield_inputs.FarfieldInput dataclass

FarfieldInput(
    analysis: str,
    input: str,
    state: str,
    source: str = "",
    reason: str = "",
    entry: str = "",
    variant: str = "",
)

One input of one analysis and how the row gets it.

Attributes:

Name Type Description
analysis str

trefftz:sections, trefftz:wake, trefftz:plane or ledgers.

input str

What the analysis reads: section_distribution, sectional_loads_export, blade_sectional_loads, vtk_export, vtk_wake, probe_points or probe_export.

state str

One of :data:FARFIELD_STATES.

source str

The declaration reused, or what the plan adds.

reason str

Why the input is not applicable or refused; empty otherwise.

entry, variant str

The requesting entry's name and public variant, assigned by the workflow.

as_record

as_record() -> dict[str, str]

Return the input as the plan output states it (FR-1047).

pyflightstream.cases.farfield_inputs.FarfieldResolution dataclass

FarfieldResolution(
    inputs: tuple[FarfieldInput, ...] = tuple(),
)

Every input of every selected analysis of one row.

refused property

refused: tuple[FarfieldInput, ...]

The inputs that cannot be produced; any one stops the plan.

added property

added: tuple[FarfieldInput, ...]

The inputs the plan adds to the row's script.

state_of

state_of(analysis: str) -> str

Return the analysis's state: refused, not_applicable, or ready (reused and added).

as_record

as_record() -> dict[str, object]

Return the row's farfield object of plan.json (FR-1047).

pyflightstream.cases.farfield_inputs.ROTOR_RUN_TYPES module-attribute

ROTOR_RUN_TYPES = frozenset(
    {"unsteady_rotor", "qsteady_rotor"}
)

pyflightstream.cases.farfield_inputs.STRIP_BIAS_PERCENT module-attribute

STRIP_BIAS_PERCENT: dict[int, float] = {
    40: 1.05,
    80: 0.52,
    160: 0.26,
}

pyflightstream.cases.farfield_inputs.UNSTEADY_RUN_TYPES module-attribute

UNSTEADY_RUN_TYPES = frozenset(
    {"unsteady", "unsteady_rotor"}
)

pyflightstream.cases.farfield_inputs.applies

applies(
    analysis: str, run_type: str, *, rotor: bool = False
) -> str

Return why analysis does not apply to run_type, or "" (FR-1059).

rotor marks a steady row whose far field is a rotor's.

Parameters:

Name Type Description Default
analysis str

Far-field analysis name, such as trefftz:sections or trefftz:wake.

required
run_type str

Resolved workflow name of the row.

required
rotor bool

Whether the row describes a rotor rather than a wing configuration.

False

Returns:

Type Description
str

Reason the analysis is inapplicable, or an empty string when applicable.

Examples:

>>> applies('trefftz:sections', 'steady')
''
>>> applies('trefftz:wake', 'unsteady')
''

pyflightstream.cases.farfield_inputs.few_stations_warning

few_stations_warning(
    family: str, per_side: int, stations: int
) -> str

Return the WARNING of a family traced on fewer stations than asked (FR-1019).

One sentence, said by the plan and by post alike: the family, its station count per side, the count its [[farfields]] sections entry asks for, and the strip bias of E_T the definitions page measured at the nearest count (:data:STRIP_BIAS_PERCENT).

Parameters:

Name Type Description Default
family str

The family the trace is of.

required
per_side int

Its station count per side of the symmetry plane.

required
stations int

The count per side its [[farfields]] sections entry asks for.

required

Returns:

Type Description
str

The sentence, or "" where the family has enough stations.

pyflightstream.cases.farfield_inputs.resolve_farfield

resolve_farfield(
    spec: FarfieldSpec,
    *,
    run_type: str,
    covered_families: Collection[str],
    selected_families: Sequence[str],
    exports: dict[str, bool],
    declares_lattice: bool,
    declares_plane: bool,
    coupled: bool,
    admits_probes: bool,
    has_command: Callable[[str], bool],
    rotor: bool = False,
    blade_loads: tuple[str, str] = ("", ""),
) -> FarfieldResolution

Resolve the inputs of every analysis spec selects for one row (FR-455).

Parameters:

Name Type Description Default
spec FarfieldSpec

The row's named [[farfields]] entry.

required
run_type str

The row's run type (steady, unsteady, unsteady_rotor, qsteady_rotor).

required
covered_families collection of str

The families a declared [sections] distribution cuts in plane XZ of a reference-axes frame (FR-1045).

required
selected_families sequence of str

The families the [[farfields]] entry resolves to on the row's geometry.

required
exports dict of str to bool

The artifact's [exports] table, as stated.

required
declares_lattice bool

Whether a [[probes]] entry declares the lattice or the plane the far field reuses (identity is the caller's test, FR-1045).

required
declares_plane bool

Whether a [[probes]] entry declares the lattice or the plane the far field reuses (identity is the caller's test, FR-1045).

required
coupled bool

Whether the row is a coupled FSI row.

required
admits_probes bool

Whether the row type takes probes at all (a steady coupled row does not).

required
has_command callable

Whether the selected build's command database records a command.

required
rotor bool

Whether a steady row's far field is a rotor's (FR-1059).

False
blade_loads tuple of str

How a rotor row gets the blade sectional loads its disk total-pressure correction reads (P0470-FFR): the state (reused, added or not_applicable) and its source or reason; empty without a rotor.

('', '')

Returns:

Type Description
FarfieldResolution

Every input with its state, source and reason.

pyflightstream.cases.farfield_inputs.traced_family

traced_family(
    families: Sequence[str], inventory: Sequence[str]
) -> str | None

Return the one family a section distribution cuts, or None (FR-1045, PFS-2081.100).

The one rule the plan and post share for whether a declared distribution serves Trefftz A: the sectional-loads export holds one block per distribution and plane, summed over the distribution's families, so only a block of exactly one family can be traced. families is the block's resolved list, where an empty list is the every-boundary form (all), resolved against inventory; a block of several families is an aggregate no export decomposes, and is not reused.

Parameters:

Name Type Description Default
families sequence of str

The families of one block, as the script records them.

required
inventory sequence of str

The geometry's families, which all stands for.

required

Returns:

Type Description
str or None

The family, or None where the block cuts none or several.