Skip to content

pyflightstream.cases.settings (provisional)

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

The solver settings, the flight-condition state and the reference data of a case.

Pipeline role: describes how a case asks the solver to solve. :class:SolverSettings holds every solver setting a row or a setup states and the command each one reaches (:data:SOLVER_SETTING_COMMANDS); :class:FluidState and :class:PointState hold the flight condition of a point, keyed by :func:point_state_key; :class:ReferenceData holds the reference quantities of the coefficients. The settings a release adds land here, beside the ones they extend.

The package root re-exports these models (AD-16). The settings read the mesh operations and the port boundaries from :mod:pyflightstream.cases.mesh, in that direction only, and this module never imports the package root.

Used in the guides

pyflightstream.cases.settings.SolverSettings

Bases: BaseModel

Solver runtime settings of one case.

Runtime fields generally match the keywords of :func:pyflightstream.script.helpers.solver_settings. Geometry controls are applied by the workflow after import/open and before dimensional frames or edge detection; they must not be forwarded to a late runtime call.

Attributes:

Name Type Description
iterations int

Solver iteration limit.

convergence float

Residual threshold declaring convergence (FSM-26.120 p.200).

forced_iterations (bool, optional)

Run the full iteration count regardless of convergence. The solver's own words are accepted too (see below).

boundary_layer (str, optional)

The boundary layer model: LAMINAR, TRANSITIONAL, or TURBULENT.

viscous_coupling (bool, optional)

Couple the boundary layer model to the potential solution. The solver's own words are accepted too (see below).

max_threads (int, optional)

Parallel core count; a row's NCPUS column wins over it.

runtime (RuntimeSettings, optional)

Launch-machine thread and affinity request; unset preserves existing behavior.

timeout_s (float, optional)

Wall-clock limit for one point's solver process; enforced by the executor, not by FlightStream.

walltime_margin_s (float, optional)

How much of a row's WALLTIME to leave for the exports, in seconds; twenty minutes when unstated. It emits nothing.

solver_model (str, optional)

The flow model the solver is initialized with, INCOMPRESSIBLE, SUBSONIC_PRANDTL_GLAUERT, TRANSONIC_FIELD_PANEL, TANGENT_CONE or MODIFIED_NEWTONIAN; an argument of INITIALIZE_SOLVER. None leaves the emitter's own default, which is INCOMPRESSIBLE.

wall_collision_avoidance (bool, optional)

The wall-collision avoidance argument of INITIALIZE_SOLVER, the other one a preset states.

convergence_iterations (int, optional)

Iterations the residual must hold under the threshold before the solver calls the run converged.

minimum_cp (float, optional)

Floor applied to the pressure coefficient.

farfield_layers (int, optional)

Farfield layer count, 1 to 5 as the command database documents; every run is expected to state 5.

mesh_induced_wake_velocity (bool, optional)

Switches the solver's mesh-induced wake velocity. This toggle and the four below it are advanced settings, and the solver's own ENABLE and DISABLE are read as well as Python booleans.

unsteady_pressure_and_kutta (bool, optional)

Switches the unsteady Bernoulli and Kutta terms of the unsteady solver.

wake_on_wake_induction (bool, optional)

Switches the wake-on-wake induced velocity computation.

additional_wake_relaxation (bool, optional)

Asks for one additional wake relaxation iteration.

reynolds_averaged_drag (bool, optional)

Switches the Reynolds-averaged (flat plate) boundary layer calculations.

solver_stabilization (float, optional)

Stabilization strength from 0 to 1 (FSM-26.120 p.346, documented range). A preset that gates it with a separate ENABLE/DISABLE key resolves the pair before it arrives here: disabled means None, not zero.

laminar_separation (bool, optional)

Switches laminar boundary layer separation.

kutta_joukowski_lift (bool, optional)

Computes the inviscid lift by the Kutta-Joukowski theorem, from the bound circulation, instead of integrating the surface pressure.

aeroelastic_rbf_type (str, optional)

The radial basis function of the aeroelastic mesh morphing.

aeroelastic_convergence_threshold (float, optional)

The convergence threshold of an aeroelastic coupling run (SET_AEROELASTIC_CONVERGENCE_THRESHOLD, 26.125, FR-423); None writes nothing and the solver keeps its default.

solver_time_averaging list of int, optional

The first and the last time iteration the solver averages the surface flow over (ENABLE_SOLVER_TIME_AVERAGING, 26.125, FR-423). Unsteady rows only; a build where no run verified the command warns. None writes nothing.

print_rotor_induced_velocities (bool, optional)

Prints the rotor-induced velocities to the log at every time step of an unsteady run.

adaptive_field_grid_refinement (bool, optional)

Refines the field-source grid where the solution needs it; the manual marks it transonic only.

rotor_induced_velocity_blending (float, optional)

Blending factor for wake stabilization, dimensionless, between 0 and 1.

wake_numerical_relaxation (float, optional)

Relaxation factor applied to the wake between iterations, dimensionless, between 0 and 1.

wake_relaxation (bool, optional)

Relaxes the wake geometry between solver iterations.

wake_decay_constant_per_m (float, optional)

Rate at which wake vorticity decays with distance, per metre.

wake_streamwise_agglomeration (bool, optional)

Agglomerates wake filament edges along the streamwise direction, so the solver carries fewer wake elements.

jet_wake_decay_normalized_length (float, optional)

Distance at which a jet wake decays to a tenth of its strength, in jet wake diameters.

jet_wake_filaments_grid_induction (bool, optional)

Whether the jet wake filaments induce velocity on the mesh.

adverse_gradient_boundary_layer (bool, optional)

Switches the adverse-pressure-gradient treatment of the boundary-layer model.

vortex_ring_normalization (bool, optional)

Normalizes the vortex-ring strengths on the wake panels.

wake_termination_revolutions (float, optional)

Wake termination stated in revolutions, negative counting backwards from the end of the run. Converted to time steps by the rotor builder, which is the only layer that knows how many steps a revolution is.

wake_termination_steps (int, optional)

Wake termination stated in time steps, negative counting backwards from the end of the run, for a run type with a clock and no rotor.

wake_termination_length (float, optional)

Wake termination stated as a length of wake in rotor radii (FR-321), converted by the rotor builder into time steps from the axial convection speed, the rotor speed and the step angle. A rotor row stating no termination keeps 4.0. At most one of this key and the two above reaches a row (FR-322).

wake_termination_thrust_n (float, optional)

The rotor thrust in newtons whose momentum-theory induced velocity convects the wake where it exceeds the free-stream speed (FR-323).

wake_termination_revolutions_cap (float, optional)

A revolution count the steps converted from a length never exceed (FR-323).

wake_termination_x_m (float or 'DEFAULT', optional)

The X of the solver's wake end plane in metres in the simulation's reference frame, the wake_termination_x argument of INITIALIZE_SOLVER (FR-324); unstated writes DEFAULT.

significant_digits (int, optional)

Output precision from 1 to 8 (FSM-26.120 p.284, documented range).

reference_velocity_m_per_s (float, optional)

The velocity the coefficients are normalised on, in m/s; unstated, the free-stream velocity.

vorticity_drag_families list of str, optional

The families whose induced drag comes from vorticity integration, by family name.

axial_separation_families list of str, optional

The families on the axial flow separation list, by family name.

delete_surfaces list of str, optional

The surfaces removed with DELETE_SURFACES after the geometry opens, by name, alias or family; the inventory is renumbered after the removal (FR-275).

slipstream_wake_stabilization (bool, optional)

The slipstream wake stabilization of each rotor motion the row creates, SET_MOTION_SLIPSTREAM_WAKE_STABILIZATION (FR-277); unstated, nothing is emitted.

load_solver_initialization (bool, optional)

Whether OPEN loads the solver initialization a saved simulation carries; unstated, it does not.

analysis_families list of str, optional

The families that enter the loads, by family name; every other boundary leaves the analysis.

load_units (str, optional)

The unit the loads table prints its forces and moments in.

inviscid_loads (bool, optional)

Reports the loads and moments without their viscous part.

vorticity_lift_model (bool, optional)

Computes the lift from the vorticity field rather than from the integrated surface pressure.

unsteady_viscous_coupling_iteration (int, optional)

The time step at which an unsteady run switches the viscous coupling on.

Notes

The toggles accept the solver's own vocabulary as well as Python booleans: viscous_coupling = 'DISABLE' in a settings file means False, the same as viscous_coupling = false. A settings preset carried over from the solver speaks ENABLE and DISABLE, and a preset is often mixed (one flag in each vocabulary), so the model reads both and stores the bool (:func:pyflightstream.script.toggles.resolve_toggle). Any other string is refused by name.

Examples:

>>> settings = SolverSettings(iterations=800, forced_iterations="ENABLE")
>>> settings.iterations, settings.forced_iterations, settings.convergence
(800, True, 1e-05)

Advanced

pyflightstream.cases.settings.FluidState

Bases: BaseModel

The resolved air state a case runs at (PFS-2027.05, PFS-2025.02.05).

Every field carries its unit in its name. It is the OUTPUT of resolving a flight condition, and it rides on the case so that a builder can emit it: the resolver lives in the workspace layer, which a builder cannot import, so the value travels rather than the computation.

source records WHICH branch produced the density, and it is not decoration. A density solved to meet a Reynolds number is not a point in any atmosphere, deliberately, and this field is what stops a later reader treating it as an altitude and "fixing" it into one.

THIS IS THE RESOLVED STATE WITHOUT ITS INPUTS, and the distinction matters for one claim. PFS-2027.05 says a reader can RECOMPUTE the resolution rather than trust it; that is true of ResolvedMatrix.conditions, which carries the condition as written, the altitude and the ISA deviation, and it is NOT true of this object, which carries none of the three. Concretely: a FluidState cannot tell sea level at ISA+15 from an altitude that happens to give the same temperature. Read the resolved condition when the inputs matter; read this when the state does.

pyflightstream.cases.settings.PointState

Bases: BaseModel

The flow state ONE point of a swept flight condition resolved to.

A row that sweeps a flow variable -- MACH:sweep, REmi:sweep, an altitude -- states a DIFFERENT condition at every point, and the condition is resolved where the reference length lives, one layer above this one. So each point's resolved state travels here, keyed by the point, and :func:case_at_point puts it on the case the builder is handed. A row that sweeps an angle or a ratio resolves once and carries none of these.

Attributes:

Name Type Description
mach, velocity, reynolds float or None

The three the case has fields for, at this point.

fluid FluidState or None

The whole resolved state, which is what a builder emits.

flight_condition dict

The condition as stated for this point: the row's cell with the swept key at this point's value.

flight_condition_defaults dict

The pins the setup supplied at this point.

flight_condition_defaults_from str

Where those pins came from, in words a reader can act on.

pyflightstream.cases.settings.ReferenceData

Bases: BaseModel

Reference quantities for coefficient normalization.

Attributes:

Name Type Description
area float

Reference area S_ref in simulation length units squared by default; square metres when normalization_units is SI.

length float

Reference length L_ref in simulation length units by default; metres when normalization_units is SI.

velocity (float, optional)

Reference velocity in m/s; None lets the recipe default it to the free-stream velocity (steady runs) or a characteristic velocity such as the rotor tip speed (FSM-26.120 p.201).

rotor_diameter (float, optional)

Rotor diameter D in simulation length units, carried from the reference artifact's rotor_diameter_m. It is the length an advance ratio is a ratio AGAINST: a row stating ADVANCE_RATIO resolves its rotor speed as n = V / (J D), so without this the ratio names no speed. None for a configuration with no rotor.

pyflightstream.cases.settings.SOLVER_SETTING_COMMANDS module-attribute

SOLVER_SETTING_COMMANDS: dict[str, str] = {
    "simulation_length_unit": "SET_SIMULATION_LENGTH_UNITS",
    "vertex_merge_tolerance_m": "SET_VERTEX_MERGE_TOLERANCE",
    "geometric_edge_bluntness_angle_deg": "SET_GEOMETRIC_EDGE_BLUNTNESS_ANGLE",
    "iterations": "SOLVER_SET_ITERATIONS",
    "convergence": "SOLVER_SET_CONVERGENCE",
    "forced_iterations": "SOLVER_SET_FORCED_ITERATIONS",
    "boundary_layer": "SET_BOUNDARY_LAYER_TYPE",
    "viscous_coupling": "SET_SOLVER_VISCOUS_COUPLING",
    "viscous_excluded": "SET_VISCOUS_EXCLUDED_BOUNDARIES",
    "surface_roughness": "SET_SURFACE_ROUGHNESS",
    "bulk_separation": "CREATE_BULK_SEPARATION",
    "airfoil_separation": "CREATE_AIRFOIL_SEPARATION",
    "axial_vortex_separation": "CREATE_AXIAL_VORTEX_SEPARATION",
    "cylindrical_bulk_separation": "CREATE_CYLINDRICAL_BULK_SEPARATION",
    "stratford_bulk_separation": "CREATE_STRATFORD_BULK_SEPARATION",
    "delete_separations": "DELETE_SEPARATION",
    "valarezo_criterion": "VALAREZO_CRITERION",
    "valarezo_separation_boundaries": "SET_VALAREZO_SEPARATION_BOUNDARIES",
    "crossflow_separation_boundaries": "SET_CROSSFLOW_SEPARATION_BOUNDARIES",
    "crossflow_separation_diameter": "SET_CROSSFLOW_SEPARATION_DIAMETER",
    "crossflow_separation_mean_diameter": "SET_CROSSFLOW_SEPARATION_CP",
    "crossflow_separation_axisymmetric": "SET_CROSSFLOW_SEPARATION_AXISYMMETRIC",
    "legacy_solver_model": "SET_SOLVER_MODEL",
    "trailing_edge_types": "SET_TRAILING_EDGE_TYPE",
    "disabled_wake_trailing_edges": "DISABLE_WAKE_NODES_ON_TRAILING_EDGE",
    "leading_edge_wake_boundaries": "DETECT_LEADING_EDGES_WAKES_BY_SURFACE",
    "mark_wake_termination_nodes": "MARK_WAKE_TERMINATION_NODES",
    "delete_inlets": "DELETE_INLET",
    "delete_outlets": "DELETE_OUTLET",
    "proximal_boundaries": "SOLVER_PROXIMAL_BOUNDARIES",
    "remove_initialization": "REMOVE_INITIALIZATION",
    "base_region_bending_angle_deg": "SET_BASE_REGION_BENDING_ANGLE",
    "delete_transition_trips": "DELETE_TRANSITION_TRIP",
    "clear_vorticity_drag_boundaries": "DELETE_VORTICITY_DRAG_BOUNDARIES",
    "max_threads": "SET_MAX_PARALLEL_THREADS",
    "runtime": "SET_MAX_PARALLEL_THREADS",
    "solver_model": "INITIALIZE_SOLVER",
    "wall_collision_avoidance": "INITIALIZE_SOLVER",
    "convergence_iterations": "SET_SOLVER_CONVERGENCE_ITERATIONS",
    "minimum_cp": "SOLVER_MINIMUM_CP",
    "farfield_layers": "SOLVER_SET_FARFIELD_LAYERS",
    "mesh_induced_wake_velocity": "SOLVER_SET_MESH_INDUCED_WAKE_VELOCITY",
    "unsteady_pressure_and_kutta": "SOLVER_UNSTEADY_PRESSURE_AND_KUTTA",
    "wake_on_wake_induction": "SET_WAKE_ON_WAKE_INDUCTION",
    "additional_wake_relaxation": "ADDITIONAL_WAKE_RELAXATION_ITERATION",
    "reynolds_averaged_drag": "REYNOLDS_AVERAGED_DRAG_FORCES",
    "solver_stabilization": "SOLVER_STABILIZATION",
    "laminar_separation": "LAMINAR_SEPARATION",
    "kutta_joukowski_lift": "KUTTA_JOUKOWSKI_LIFT_FORCES",
    "aeroelastic_rbf_type": "AEROELASTIC_RBF_TYPE",
    "print_rotor_induced_velocities": "PRINT_ROTOR_INDUCED_VELOCITIES",
    "adaptive_field_grid_refinement": "SET_ADAPTIVE_FIELD_GRID_REFINEMENT",
    "rotor_induced_velocity_blending": "ROTOR_INDUCED_VELOCITY_BLENDING",
    "wake_numerical_relaxation": "SET_WAKE_NUMERICAL_RELAXATION",
    "wake_relaxation": "SET_WAKE_RELAXATION",
    "wake_decay_constant_per_m": "SET_WAKE_DECAY_CONSTANT",
    "wake_streamwise_agglomeration": "SET_WAKE_STREAMWISE_AGGLOMERATION",
    "jet_wake_decay_normalized_length": "SET_JET_WAKE_DECAY_NORMALIZED_LENGTH",
    "jet_wake_filaments_grid_induction": "SET_JET_WAKE_FILAMENTS_GRID_INDUCTION",
    "adverse_gradient_boundary_layer": "SOLVER_SET_ADVERSE_GRADIENT_BOUNDARY_LAYER",
    "vortex_ring_normalization": "SOLVER_VORTEX_RING_NORMALIZATION",
    "wake_termination_revolutions": "SET_WAKE_TERMINATION_TIME_STEPS",
    "wake_termination_steps": "SET_WAKE_TERMINATION_TIME_STEPS",
    "wake_termination_length": "SET_WAKE_TERMINATION_TIME_STEPS",
    "wake_termination_thrust_n": "SET_WAKE_TERMINATION_TIME_STEPS",
    "wake_termination_revolutions_cap": "SET_WAKE_TERMINATION_TIME_STEPS",
    "wake_termination_x_m": "INITIALIZE_SOLVER",
    "significant_digits": "SET_SIGNIFICANT_DIGITS",
    "reference_velocity_m_per_s": "SOLVER_SET_REF_VELOCITY",
    "freestream_input": "SOLVER_SET_MACH_NUMBER",
    "reference_mach": "SOLVER_SET_REF_MACH_NUMBER",
    "disable_reference_velocity": "DISABLE_SOLVER_REF_VELOCITY",
    "vorticity_drag_families": "SET_VORTICITY_DRAG_BOUNDARIES",
    "axial_separation_families": "SET_AXIAL_SEPARATION_BOUNDARIES",
    "delete_surfaces": "DELETE_SURFACES",
    "slipstream_wake_stabilization": "SET_MOTION_SLIPSTREAM_WAKE_STABILIZATION",
    "load_solver_initialization": "OPEN",
    "analysis_families": "SET_SOLVER_ANALYSIS_BOUNDARIES",
    "load_units": "SET_LOADS_AND_MOMENTS_UNITS",
    "inviscid_loads": "SET_INVISCID_LOADS",
    "vorticity_lift_model": "SET_VORTICITY_LIFT_MODEL",
    "unsteady_viscous_coupling_iteration": "SET_UNSTEADY_VISCOUS_COUPLING_ITERATION",
    "moments_model": "SET_ANALYSIS_MOMENTS_MODEL",
    "unsteady_solver_actions": "SET_NEW_UNSTEADY_SOLVER_ACTION",
    "aeroelastic_convergence_threshold": "SET_AEROELASTIC_CONVERGENCE_THRESHOLD",
    "solver_time_averaging": "ENABLE_SOLVER_TIME_AVERAGING",
}

pyflightstream.cases.settings.SolverToggle module-attribute

SolverToggle = Annotated[
    bool,
    BeforeValidator(
        _resolve_settings_toggle,
        json_schema_input_type=Toggle,
    ),
]

pyflightstream.cases.settings.point_state_key

point_state_key(point: Mapping[str, float]) -> str

Return the key one point's resolved state is filed under.

The point itself, written to ten significant figures per axis and sorted, so the same point read from a matrix, a plan or a record finds its state.

Parameters:

Name Type Description Default
point mapping of str to float

The point's coordinates.

required

Returns:

Type Description
str

axis=value for each axis, sorted by axis and joined by |.

Examples:

>>> point_state_key({"beta": 0.0, "alpha": 2.0})
'alpha=2|beta=0'
>>> point_state_key({"beta": -0.0})
'beta=0'