Skip to content

pyflightstream.farfield (stable)

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

The far-field family: Trefftz-plane drag and survey balances, on numpy.

Pipeline role: the one home of every far-field analysis (FR-450). A facade over a numpy core with no input or output: :mod:.fields (the survey and plane containers and the one refusal), :mod:.quadrature (the plane, ring and strip rules and the harmonic layer, each once), :mod:.balances (the conservation balances of a survey lattice, FR-38) and :mod:.trefftz (the discrete trace of variants A and B and the probe plane of variant C, FR-451 to FR-453). A user reaches them through the [[farfields]] entries of the pproc artifact; the post step reads the exports, turns the vectors and calls this core.

The equations are those of the definitions page, The far-field family. The names lattice_dataset, rothalpy and irreversible_deficit were removed and refuse, naming what replaced them (FR-457, FR-458).

UNITS. The core converts nothing. A ledger is the field's units times the square of the length unit of tip_radius (the areas it integrates over are tip_radius**2 times a dimensionless weight), so it is in SI (N, W, kg/s, N m) only when the fields are in SI and tip_radius is in METRES. The post step supplies metres. A caller holding R in the simulation's own unit converts it first; the survey's import csv is the other place a unit enters, stated by the caller of :func:pyflightstream.probes.emit_probe_import (the plan passes the setup's simulation length unit, METER when the setup states none).

Advanced

pyflightstream.farfield.CrossflowEnergy dataclass

CrossflowEnergy(
    total: ndarray, swirl: ndarray, induced: ndarray
)

The crossflow kinetic-energy flux per station, split by channel (W).

pyflightstream.farfield.FarfieldInputError

Bases: PyflightstreamError, ValueError

A far-field reduction was given fields it cannot integrate.

Survey fields missing a sample array the ledger needs, a harmonic request the azimuthal sampling cannot resolve, a flux or moment call whose arrays do not agree on shape or frame, a station the lattice does not carry.

Also inherits from ValueError.

pyflightstream.farfield.InPlaneMoment dataclass

InPlaneMoment(
    loading_term: float,
    moment_arm_term: float,
    total: float,
)

An in-plane moment split into its loading and moment-arm terms (N m).

pyflightstream.farfield.LatticeFields dataclass

LatticeFields(
    stations: ndarray,
    ring_centers: ndarray,
    ring_edges: ndarray,
    psi: ndarray,
    tip_radius: float,
    values: Mapping[str, ndarray],
    lateral_radius: float | None = None,
    lateral_stations: ndarray = (lambda: np.empty(0))(),
    lateral_values: Mapping[str, ndarray] = _EMPTY,
)

Samples of a cylindrical survey lattice with its coordinates.

Attributes:

Name Type Description
stations ndarray

Axial positions x/R of the annular planes, shape (n_stations,).

ring_centers ndarray

Sampling radii r/R, shape (n_r,).

ring_edges ndarray

Ring edges r/R, shape (n_r + 1,); the quadrature weights come from them.

psi ndarray

Uniform azimuths in radians, shape (n_psi,).

tip_radius float

Reference radius R, in THE LENGTH UNIT OF THE SAMPLES' POSITIONS. No unit conversion is performed by this container or by :func:lattice_fields: every area the balances integrate over is tip_radius squared times a dimensionless weight, so a ledger comes out in the field's units times that length unit squared (N for a momentum flux, W for an energy flux, kg/s for a mass flux, when the fields are in SI) and is SI only when R is given in metres. The post product path gives metres: it builds the lattice from the metre radius the artifact states and turns the exported coordinates into metres by the saved simulation's unit before it reads them. A caller of this library holding R in the simulation's unit (millimetres, say) owns the conversion: pass tip_radius in metres, with the fields in SI.

values mapping of str to numpy.ndarray

Sampled fields, each shaped (n_stations, n_r, n_psi).

lateral_radius float or None

Radius r/R of the lateral closure cylinder; None without one.

lateral_stations ndarray

Axial positions x/R of the lateral rings, shape (n_lateral,).

lateral_values mapping of str to numpy.ndarray

Lateral ring samples, each shaped (n_lateral, n_psi).

shape property

shape: tuple[int, int, int]

The sample shape (n_stations, n_r, n_psi).

with_values

with_values(**arrays: ndarray) -> LatticeFields

Return a copy with fields added or replaced (shapes checked).

with_lateral_values

with_lateral_values(**arrays: ndarray) -> LatticeFields

Return a copy with lateral-ring fields added or replaced.

station_index

station_index(station: float) -> int

Return the index of a station x/R, allowing floating-point roundoff.

An exact match wins; otherwise the one station within 1e-12 (relative and absolute) is taken, so 0.1 * 3 finds the plane at 0.3. A nearby plane is never guessed.

Raises:

Type Description
FarfieldInputError

If no plane, or more than one, lies at station within the roundoff tolerance; the message names the available stations.

points

points() -> tuple[np.ndarray, dict[str, np.ndarray]]

Flatten the survey into the inputs of the point writers.

The replacement of the retired post.dataset_to_points: positions rebuilt from the survey coordinates (x = station R, y = r sin(psi) R, z = r cos(psi) R, the convention of :mod:pyflightstream.probes) and every field flattened in the same station, ring, azimuth order, so the result drops straight into :func:pyflightstream.post.writers.write_vtk_points or :func:pyflightstream.post.writers.write_tecplot_points.

Returns:

Type Description
tuple

(points, fields): positions (n, 3) in the length unit of tip_radius (metres on the post product path) and the flattened scalar fields.

pyflightstream.farfield.MassClosure dataclass

MassClosure(
    mdot: ndarray,
    relative_spread: float,
    absolute_spread: float = float("nan"),
    status: str = "ok",
)

Gate G1: the mass flow per station and its relative spread.

Attributes:

Name Type Description
mdot ndarray

Mass flow through each annular plane, kg/s.

relative_spread float

max |mdot - mean| / |mean| over the stations; NaN where any station is incomplete or where the mean is zero (see status).

absolute_spread float

max |mdot - mean| in kg/s; NaN where any station is incomplete.

status str

"ok" when relative_spread is defined; "incomplete" where a station has a missing sample; "zero-mean-zero-spread" for a zero mean with every station equal (nothing flows anywhere); and "zero-mean-nonzero-spread" for a zero mean with unequal stations, where only absolute_spread carries the answer.

pyflightstream.farfield.PlaneDrag dataclass

PlaneDrag(
    induced_drag: float,
    coarse_drag: float,
    quadrature_error: float,
    coverage: float,
)

The crossflow-energy induced drag of a probe plane (Trefftz C).

Attributes:

Name Type Description
induced_drag float

D_i by the trapezoid rule on the whole grid, N.

coarse_drag float

The same samples integrated on every other grid point, N; NaN where the grid's point counts do not allow it to span the same extent.

quadrature_error float

induced_drag - coarse_drag, N.

coverage float

The fraction of the plane's AREA whose crossflow samples are finite, each sample weighted by the area its trapezoid weight integrates.

pyflightstream.farfield.PlaneFields dataclass

PlaneFields(
    y: ndarray, z: ndarray, values: Mapping[str, ndarray]
)

Samples of a uniform rectangular far-field plane (Trefftz C, wing).

Attributes:

Name Type Description
y, z ndarray

The grid axes in the plane, in m, uniform and strictly increasing, shapes (n_y,) and (n_z,); y to the right and z up in the wind axes of the point.

values mapping of str to numpy.ndarray

Sampled fields, each shaped (n_y, n_z): u, v, w in wind axes (m/s) and p_prime (Pa) where the analysis needs it.

pyflightstream.farfield.RUN_GAP_FACTOR module-attribute

RUN_GAP_FACTOR = 4.0

pyflightstream.farfield.RotorChannels dataclass

RotorChannels(
    station: float,
    p_axial: float,
    p_swirl: float,
    p_crossflow: float,
    p_total: float,
    thrust: float,
    eta_ff: float,
    coverage: float,
)

The far-field loss channels of a rotor at one lattice station (W).

thrust is the axial force of the balance between the inlet and the station (N); eta_ff is NaN at V = 0.

pyflightstream.farfield.SheetCrossings dataclass

SheetCrossings(
    y: ndarray,
    z: ndarray,
    values: ndarray,
    closed: bool,
    index: ndarray,
    short: int,
    blade: bool = False,
)

Where one sheet's lines cross the plane.

Attributes:

Name Type Description
y, z ndarray

The crossings in walking order, m.

values ndarray

The exported value of each crossing's line.

closed bool

Whether the sheet is a ring.

index ndarray

Positions of the lines in the input.

short int

How many of the sheet's lines end before the plane.

blade bool

A blade ordered root to tip: accumulate inward from its free tip, without a closure constraint or a central strip connecting its mirror image.

pyflightstream.farfield.TraceResult dataclass

TraceResult(
    lift: float,
    side_force: float,
    induced_drag: float,
    sheets: tuple[int, ...],
    sheet_lift: ndarray,
    sheet_side_force: ndarray,
    sheet_drag_share: ndarray,
    sheet_drag_isolated: ndarray,
    y: ndarray,
    z: ndarray,
    dy: ndarray,
    dz: ndarray,
    ds: ndarray,
    gamma: ndarray,
    normalwash: ndarray,
    sheet: ndarray,
    original: ndarray,
)

The forces of a discrete trailing-vortex trace and its strips.

Forces are those of the traced (mirrored, where asked) configuration, in N; the per-strip arrays run over every strip of the trace.

Attributes:

Name Type Description
lift, side_force, induced_drag float

L, Y and D_i of the whole trace, N.

sheets tuple of int

The sheet labels, in order of first appearance.

sheet_lift, sheet_side_force ndarray

Per sheet, N.

sheet_drag_share ndarray

Per sheet, the drag of its strips under the normalwash of every sheet's filaments; the shares add up to induced_drag.

sheet_drag_isolated ndarray

Per sheet, the drag of its strips under its own filaments only.

y, z, dy, dz, ds, gamma ndarray

Per strip: the point, the strip's projections and length (m), and the circulation (m^2/s).

normalwash ndarray

Per strip, the Trefftz-plane velocity along the strip's upward normal, induced by every sheet (m/s).

sheet ndarray

Per strip, its sheet label.

original ndarray

Per strip, True where the strip is a station of the input (False on a mirror image).

downwash property

downwash: ndarray

Per strip, the downwash at the lifting line, m/s, positive down.

scaled

scaled(k: float) -> TraceResult

Return the trace of the circulation k Gamma: forces times k or k^2.

pyflightstream.farfield.TransverseForce dataclass

TransverseForce(
    plane_term: float, lateral_term: float, total: float
)

A transverse force with its lateral term reported separately (N).

pyflightstream.farfield.WakeLoads dataclass

WakeLoads(
    thrust: float, torque: float, blades: int, lines: int
)

Rotor thrust and torque from the circulation its blades shed (option 3).

Attributes:

Name Type Description
thrust float

T_w = rho sum_b int Gamma_b (Omega r - w_t) dr, N, the force on the blades along the rotor axis e_a.

torque float

Q_w = rho sum_b int Gamma_b (V_a + w_a) r dr, N m, about e_a.

blades int

Blades whose lines were traced, periodic copies included.

lines int

Wake lines read, before periodic copies.

pyflightstream.farfield.WakeSheet dataclass

WakeSheet(index: ndarray, closed: bool)

One sheet of the export: the lines it holds, in the order the trace walks them.

Attributes:

Name Type Description
index ndarray

Positions in the input of the sheet's lines, in walking order: from the end farthest from the symmetry plane to the end nearest it for an open sheet, around the ring from the line of smallest y for a closed one.

closed bool

True where the first nodes close into a ring (a base rim).

pyflightstream.farfield.WakeTrace dataclass

WakeTrace(
    y: ndarray,
    z: ndarray,
    values: ndarray,
    short: int,
    problem: str | None,
)

Where the solver's wake lines cross a Trefftz plane (variant B).

Attributes:

Name Type Description
y, z ndarray

The crossings in span order, m.

values ndarray

The circulation shed by each crossing's line, with the exported sign.

short int

How many lines end before the plane.

problem str or None

Why the crossings are no trace (lines falling short, a start run that is not one sheet), or None.

forces

forces(
    *, rho: float, v_inf: float, mirror: bool = False
) -> TraceResult

Integrate the circulation shed by the lines between their crossings.

Parameters:

Name Type Description Default
rho float

Density in kg/m3 and free-stream speed in m/s.

required
v_inf float

Density in kg/m3 and free-stream speed in m/s.

required
mirror bool

The crossings are one half of a mirror model. Sum the negative exported strengths from the tip inwards, then reflect the strips. For a full sheet, sum signed strengths from its first edge.

False

Returns:

Type Description
TraceResult

Forces and strip data. Each strip lies between two wake lines, with circulation accumulated from the exterior zero value.

Raises:

Type Description
FarfieldInputError

If the crossings do not form an integrable sheet.

pyflightstream.farfield.axial_flux

axial_flux(
    fields: LatticeFields, rho: float, v_inf: float
) -> np.ndarray

Axial momentum-plus-pressure flux per station (N).

integral(rho u (u - v_inf) + p_prime) dA with the axial perturbation u' = u - v_inf (DLV-006 Sec. 3.3).

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required

Returns:

Type Description
ndarray

Axial momentum-plus-pressure flux in N for each station.

pyflightstream.farfield.axial_force

axial_force(
    fields: LatticeFields,
    rho: float,
    v_inf: float,
    *,
    inlet: float,
    outlet: float,
) -> float

Axial force from the control volume between two stations (N).

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples.

required
rho float

Density (kg/m3); the free-stream value on the FlightStream side.

required
v_inf float

Free-stream axial velocity (m/s).

required
inlet float

Station coordinates x/R of the inlet and outlet planes, matched exactly; the lateral cylinder is assumed at free stream, which the lateral ring probes must verify (DLV-006 Sec. 2.1).

required
outlet float

Station coordinates x/R of the inlet and outlet planes, matched exactly; the lateral cylinder is assumed at free stream, which the lateral ring probes must verify (DLV-006 Sec. 2.1).

required

Returns:

Type Description
float

F_X = outlet flux minus inlet flux, +x downstream, so a propulsive disk yields positive axial force.

pyflightstream.farfield.azimuthal_harmonics

azimuthal_harmonics(
    values: ndarray, *, psi: ndarray, m_max: int = 6
) -> np.ndarray

Azimuthal Fourier coefficients of a sampled field, the ledger spine.

Coefficients follow f(psi) = sum_m c_m exp(i m psi) with c_m = (1/N) sum_k f_k exp(-i m psi_k); for real fields the negative orders are the conjugates and are not stored.

Parameters:

Name Type Description Default
values ndarray

Field whose last axis runs over the uniform lattice azimuths.

required
psi ndarray

The azimuths of that axis, radians.

required
m_max int

Highest stored order; DLV-006 Sec. 3.2 requires at least 6.

6

Returns:

Type Description
ndarray

Complex coefficients, the last axis replaced by the orders 0..m_max. Order 0 carries forces, order 1 the in-plane moments, orders 2 and above the distortion a downstream surface sees.

Raises:

Type Description
FarfieldInputError

If the azimuth grid or requested harmonic order is invalid.

pyflightstream.farfield.bernoulli_residual

bernoulli_residual(
    plane: PlaneFields, *, rho: float, v_inf: float
) -> float

Return the Betz-Maskell term of a plane, in N (FR-1031).

With the total-pressure deficit p0_inf - p0 = -p' - (rho / 2) (u^2 + v^2 + w^2 - V^2) and the artificial axial velocity u* = sqrt(u^2 + 2 (p0_inf - p0) / rho), integral over p0 < p0_inf of [(p0_inf - p0) + (rho / 2) (u* - u) (u* + u - 2 V)] dS. Zero by construction in a field that holds Bernoulli's relation; written as a diagnostic, never as a drag.

Parameters:

Name Type Description Default
plane PlaneFields

Rectangular probe-plane samples in free-stream axes.

required
rho float

Density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required

Returns:

Type Description
float

Integrated Betz-Maskell diagnostic in N over the total-pressure deficit region.

pyflightstream.farfield.calibration_scale

calibration_scale(
    raw_lift: float,
    *,
    cl_near: float,
    q: float,
    s_ref: float,
) -> float

Return the scale k that makes a trace's lift the solver's own (FR-1024).

The wake export's value is proportional to the circulation with a scale the solver does not document; Gamma = k Gamma_raw with k = CL_near q SREF / L_raw, L_raw the lift the raw values give, so CL_T of variant B equals the solver's CL by construction. NaN where the near-field CL is missing or zero, or the raw lift is zero.

Parameters:

Name Type Description Default
raw_lift float

The lift of the trace traced with the raw values, N, already counted as the polar counts it (the meshed half of a half model whose loads are not doubled).

required
cl_near float

The solver's CL of the point.

required
q float

Dynamic pressure (Pa) and reference area (m2).

required
s_ref float

Dynamic pressure (Pa) and reference area (m2).

required

Returns:

Type Description
float

Circulation scale, or NaN when lift cannot define it.

pyflightstream.farfield.crossflow_integrand

crossflow_integrand(
    rho: float,
    *,
    first: ndarray,
    second: ndarray,
    advecting: ndarray | float,
) -> np.ndarray

Return the one crossflow kinetic-energy integrand, (rho / 2) (a^2 + b^2) u_adv.

The balance passes the cylindrical components v_r, v_theta and the sampled axial velocity u; Trefftz C passes the Cartesian crossflow v, w and the free-stream speed V (FR-1003, FR-1030). The integrand is transverse components only: it contains no axial-deficit term by construction, a hard rule of the design note.

Parameters:

Name Type Description Default
rho float

Density in kg/m3.

required
first ndarray

First transverse velocity component, in m/s.

required
second ndarray

Second transverse velocity component, in m/s.

required
advecting ndarray | float

Advecting velocity in m/s, scalar or sampled with the components.

required

Returns:

Type Description
ndarray

Crossflow kinetic-energy flux density at each sample.

pyflightstream.farfield.crossflow_kinetic_energy

crossflow_kinetic_energy(
    fields: LatticeFields, rho: float
) -> CrossflowEnergy

Crossflow kinetic-energy flux split into swirl and induced content (W).

E = 0.5 integral(rho (v_r^2 + v_theta^2) u dA) per station, with the axisymmetric (order-0) v_theta part reported as the stator-recoverable swirl channel and the remainder as the non-axisymmetric induced channel (DLV-006 Sec. 3.5).

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required

Returns:

Type Description
CrossflowEnergy

Total, swirl and induced energy flux in W for each station.

pyflightstream.farfield.cylindrical_components

cylindrical_components(
    fields: LatticeFields,
) -> LatticeFields

Add the cylindrical velocity components v_r and v_theta.

Convention (fixed here and pinned by a tier-1 test, DLV-006 Sec. 3.1): y = r sin(psi), z = r cos(psi), so the radial unit vector is (0, sin psi, cos psi) and the azimuthal unit vector, in the direction of growing psi (+z toward +y), is (0, cos psi, -sin psi). A right-handed rotation about +x therefore has negative v_theta in this convention. The lateral rings gain the same two components where they carry v and w.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples carrying v and w (m/s).

required

Returns:

Type Description
LatticeFields

A copy with v_r and v_theta added (m/s).

pyflightstream.farfield.grid_coverage

grid_coverage(
    integrand: ndarray,
    *,
    y: ndarray | None = None,
    z: ndarray | None = None,
) -> float

Fraction of the plane's area whose samples are finite.

With the grid axes y and z each sample is weighted by the area the trapezoid rule of :func:grid_integral gives it (:func:grid_weights: a quarter cell at a corner, half at an edge, a whole cell inside), so the figure is the fraction of the INTEGRAL's area that was sampled. Without the axes every sample counts equally, which is the area fraction only when the samples stand for equal areas.

Parameters:

Name Type Description Default
integrand ndarray

Sampled scalar integrand, with shape (len(y), len(z)) for a grid.

required
y ndarray

The grid axes, m; both or neither.

None
z ndarray

The grid axes, m; both or neither.

None

Returns:

Type Description
float

Fraction of the grid's represented area carrying finite integrand values.

Raises:

Type Description
FarfieldInputError

If only one axis is given.

pyflightstream.farfield.grid_integral

grid_integral(
    y: ndarray, *, z: ndarray, integrand: ndarray
) -> float

Integrate a sampled field over a uniform rectangular grid by the trapezoid rule.

A missing or non-finite sample makes the integral NaN (PYFS-010).

Parameters:

Name Type Description Default
y ndarray

Ordered spanwise grid coordinates in m.

required
z ndarray

Ordered vertical grid coordinates in m.

required
integrand ndarray

Sampled scalar integrand, with shape (len(y), len(z)) for a grid.

required

Returns:

Type Description
float

Trapezoidal integral over the rectangular grid.

Raises:

Type Description
FarfieldInputError

If the integrand is not shaped (len(y), len(z)).

pyflightstream.farfield.grid_weights

grid_weights(y: ndarray, *, z: ndarray) -> np.ndarray

Trapezoid weights of a uniform rectangular grid, in m^2.

Corners carry a quarter of a cell, edges a half, the inside a whole cell.

Parameters:

Name Type Description Default
y ndarray

Uniform grid axes, m.

required
z ndarray

Uniform grid axes, m.

required

Returns:

Type Description
ndarray

Weights shaped (len(y), len(z)).

pyflightstream.farfield.hub_frame_velocities

hub_frame_velocities(
    points: ndarray,
    *,
    velocities: ndarray,
    omega: float,
    axis: ndarray,
    origin: ndarray,
) -> np.ndarray

Convert velocities sampled in a frame turning with a rotor to its hub frame.

A quasi-steady rotor holds its blades still and carries the rotation in the free stream, so a probe there is taken to read the velocity relative to a frame that turns at omega about axis (FR-1037; not measured in a committed report). The hub-frame velocity adds back the frame velocity at the probe, v_hub = v + Omega x (x - x_hub) with Omega = omega axis (FR-1037). The positions are not moved: the balances of one solve read the field at one instant, where the two frames coincide.

Parameters:

Name Type Description Default
points ndarray

Probe positions, shape (n, 3), m, in the frame the velocities are stated in.

required
velocities ndarray

Sampled velocities in the turning frame, shape (n, 3), m/s.

required
omega float

Signed rotational speed in rad/s about axis (right-handed); the sign is the sense of the rotor's speed.

required
axis ndarray

The rotation axis, shape (3,); normalized here.

required
origin ndarray

A point of the rotation axis (the hub), shape (3,), m.

required

Returns:

Type Description
ndarray

Hub-frame velocities, shape (n, 3), m/s.

Raises:

Type Description
FarfieldInputError

If the axis is not a finite non-zero vector, or points and velocities are not matching (n, 3) arrays.

pyflightstream.farfield.in_plane_moment

in_plane_moment(
    fields: LatticeFields,
    rho: float,
    v_inf: float,
    *,
    inlet: float,
    outlet: float,
    axis: str = "y",
    method: str = "quadrature",
) -> InPlaneMoment

In-plane moment about an axis through the disk center (N m).

For axis="y" (DLV-006 Sec. 3.4): M_Y = integral(z g dA) - x_p integral(rho u w dA) evaluated at the outlet minus the same terms at the inlet, with g = rho u u' + p_prime and z = r cos(psi). The two contributions stay separate: the loading term is the order-1 cosine harmonic of the axial flux (the 1P loading asymmetry) and the moment-arm term carries the transverse flux. Both axes follow the right-handed cross product: axis="z" gives M_Z = x_p integral(rho u v dA) - integral(y g dA), with y = r sin(psi).

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples.

required
rho float

Density (kg/m3) and free-stream axial velocity (m/s).

required
v_inf float

Density (kg/m3) and free-stream axial velocity (m/s).

required
inlet float

Station coordinates x/R of the bounding planes; the moment arm of each plane is its own station position.

required
outlet float

Station coordinates x/R of the bounding planes; the moment arm of each plane is its own station position.

required
axis str

"y" or "z", the moment axis through the disk center.

'y'
method str

"quadrature" weights the axial flux by the sampled lever arm directly; "harmonic" rebuilds the loading term from the order-1 azimuthal coefficient. Two independent code paths.

'quadrature'

Returns:

Type Description
InPlaneMoment

Loading, moment-arm and total moment terms in N m. The total is plane-only: unlike :func:transverse_force it has no lateral-cylinder term, so it is valid where the lateral flux vanishes (zero incidence, or a lateral cylinder at free stream).

Raises:

Type Description
FarfieldInputError

If axis or integration method is unsupported.

pyflightstream.farfield.lateral_flux

lateral_flux(
    fields: LatticeFields,
    *,
    rho: float,
    inlet: float,
    outlet: float,
    component: str = "w",
) -> float

Momentum-plus-pressure flux through the lateral cylinder between two stations (N).

D_lat = integral over the cylinder of (rho v_r c + p' n_c) dA with c the transverse component (w for F_Z, v for F_Y) and n_c its share of the outward normal (cos psi for w, sin psi for v): the azimuthal rectangle rule around each lateral ring and the trapezoid rule along x over the lateral stations from inlet to outlet. NaN where a ring sample is missing. Stations match within 1e-12 as the annular planes do. The far-field family definition states the balance from the inlet station downstream and no convention for a reversed pair, so an outlet upstream of inlet is refused rather than given a sign; equal stations bound no cylinder and give 0.0.

Raises:

Type Description
FarfieldInputError

If the lattice has no lateral cylinder, its samples carry no v_r, p_prime or component, inlet or outlet is not a lateral station, or outlet lies upstream of inlet.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required
inlet float

Inlet station coordinate x/R.

required
outlet float

Outlet station coordinate x/R.

required
component str

Transverse velocity field name: v for +y or w for +z.

'w'

Returns:

Type Description
float

Lateral-cylinder momentum-plus-pressure flux in N.

pyflightstream.farfield.lattice_fields

lattice_fields(
    lattice: ProbeLattice,
    *,
    fields: Mapping[str, ndarray],
    lateral: Mapping[str, ndarray] | None = None,
) -> LatticeFields

Assemble the survey samples of a lattice, the replacement of lattice_dataset.

Parameters:

Name Type Description Default
lattice ProbeLattice

Lattice that placed the probes; supplies stations, ring centers, ring edges, azimuths, the tip radius and the lateral cylinder. Supply the tip radius in metres for SI balances; this function copies it without converting simulation length units.

required
fields mapping of str to numpy.ndarray

Sampled fields of the annular planes, each shaped (n_stations, n_r, n_psi) in the lattice sampling order.

required
lateral mapping of str to numpy.ndarray

Sampled fields of the lateral rings, each (n_lateral, n_psi).

None

Returns:

Type Description
LatticeFields

The frozen container every balance integrates.

pyflightstream.farfield.mass_closure

mass_closure(
    fields: LatticeFields, rho: float
) -> MassClosure

Gate G1: station-to-station mass-flow closure diagnostic.

Returns:

Type Description
MassClosure

mdot per station (kg/s) and the scalar relative_spread (max deviation from the station mean over the mean); reported per run, judged against the case tolerance elsewhere.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required

pyflightstream.farfield.mass_flux

mass_flux(fields: LatticeFields, rho: float) -> np.ndarray

Mass flow through each annular plane, integral(rho u dA) in kg/s.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required

Returns:

Type Description
ndarray

Mass flow in kg/s for each station.

pyflightstream.farfield.plane_fields

plane_fields(
    y: object, *, z: object, fields: Mapping[str, ndarray]
) -> PlaneFields

Assemble the samples of a far-field plane.

Parameters:

Name Type Description Default
y array_like

Uniform grid axes in m, each with at least three points.

required
z array_like

Uniform grid axes in m, each with at least three points.

required
fields mapping of str to numpy.ndarray

Sampled fields shaped (len(y), len(z)).

required

Returns:

Type Description
PlaneFields

The frozen container the Trefftz C integrals take.

Raises:

Type Description
FarfieldInputError

If coordinates or field arrays do not form the declared rectangular plane.

pyflightstream.farfield.plane_induced_drag

plane_induced_drag(
    plane: PlaneFields, *, rho: float, v_inf: float
) -> PlaneDrag

Induced drag from the crossflow kinetic energy on a plane (FR-1030).

D_i = (rho / 2) integral (v^2 + w^2) dS: the crossflow-energy integrand of the balances advected by V and divided by it, so the balance and Trefftz C share one integrand (FR-1003). NaN at V = 0.

Parameters:

Name Type Description Default
plane PlaneFields

Rectangular probe-plane samples in free-stream axes.

required
rho float

Density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required

Returns:

Type Description
PlaneDrag

Fine and coarse induced drag in N, their difference and sample coverage.

pyflightstream.farfield.plane_integral

plane_integral(
    fields: LatticeFields, integrand: ndarray
) -> np.ndarray

Integrate a sampled field over each annular plane.

Implemented once and reused by every balance (DLV-006 Sec. 3.1): the ring-edge rule in radius times the rectangle rule in azimuth.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples supplying the weights and the tip radius.

required
integrand ndarray

Any array whose two trailing axes are (n_r, n_psi).

required

Returns:

Type Description
ndarray

The integral over the two trailing axes, the leading axes preserved, in integrand units times square meters; NaN where any sample is not finite.

Raises:

Type Description
FarfieldInputError

If the trailing axes are not (n_r, n_psi) of the lattice.

pyflightstream.farfield.plane_lift

plane_lift(
    plane: PlaneFields, *, rho: float, v_inf: float
) -> float

Lift from the first moment of the streamwise vorticity on a plane (FR-1038).

L = rho V sum_P y_P xi_P dS_P with xi = dw/dy - dv/dz by central differences on the grid: the Kutta-Joukowski lift of the trailing vorticity the plane holds, which for a flat sheet of strip circulation Gamma is rho V integral Gamma dy and which roll-up does not change. It does not depend on where y is measured from once the plane holds the whole wake (its vorticity then sums to zero). NaN where any sample is missing.

Parameters:

Name Type Description Default
plane PlaneFields

Rectangular probe-plane samples in free-stream axes.

required
rho float

Density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required

Returns:

Type Description
float

Lift in N, positive along the plane's z.

pyflightstream.farfield.plane_vorticity_drag

plane_vorticity_drag(
    plane: PlaneFields, *, rho: float, chunk: int = 512
) -> float

Induced drag from the streamwise vorticity on a plane (Maskell, FR-1030).

xi = dw/dy - dv/dz by central differences on the grid, its stream function psi(P) = -(1 / (2 pi)) sum_Q xi_Q ln|P - Q| dS_Q (the cell's own logarithm integrated exactly), and D = (rho / 2) sum_P psi_P xi_P dS_P. NaN where any sample is missing.

Parameters:

Name Type Description Default
plane PlaneFields

Rectangular probe-plane samples in free-stream axes.

required
rho float

Density in kg/m3.

required
chunk int

Number of source cells processed together to bound temporary memory; a positive integer.

512

Returns:

Type Description
float

Induced drag in N from the plane vorticity.

Raises:

Type Description
FarfieldInputError

If the density is not finite and positive, or chunk is not a positive integer.

pyflightstream.farfield.ring_sample_weights

ring_sample_weights(fields: LatticeFields) -> np.ndarray

Per-sample annular quadrature weights of each ring.

Returns:

Type Description
ndarray

0.5 (r_{j+1/2}^2 - r_{j-1/2}^2) dpsi per ring, shape (n_r,), in units of the tip radius squared; multiplying an integrand sample and summing over rings and azimuths is the whole plane quadrature of DLV-006 Sec. 3.1.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required

pyflightstream.farfield.rotor_channels

rotor_channels(
    fields: LatticeFields,
    *,
    rho: float,
    v_inf: float,
    station: float,
) -> RotorChannels

Axial, swirl and crossflow loss powers of a rotor at a station (FR-1032).

P_AXIAL = (rho / 2) I[u'^2 u], P_SWIRL and P_CROSSFLOW the swirl and induced channels of the crossflow kinetic energy (one integrand), P_TOTAL = I[(p0 - p0_inf) u] and ETA_FF = T V / (T V + P_AXIAL + P_SWIRL + P_CROSSFLOW) with T the axial force between the first station and this one.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required
station float

Outlet station coordinate x/R.

required

Returns:

Type Description
RotorChannels

Rotor loss powers in W, axial force in N, efficiency and coverage.

pyflightstream.farfield.rotor_wake_lines

rotor_wake_lines(
    lines: Sequence[ndarray],
    *,
    hub: Sequence[float],
    axis: Sequence[float],
    radius: float,
    reach: float,
) -> np.ndarray

Return which wake lines leave the rotor, by where each one starts.

A line leaves the rotor when its first node lies within radius of the rotor axis and within reach of the hub plane along it; every other line leaves another family (a wing). Each line is assigned exactly once.

Parameters:

Name Type Description Default
lines sequence of numpy.ndarray

One (n_k, 3) array per wake line, its first node on the trailing edge.

required
hub sequence of float

The hub origin, in the lines' unit and frame.

required
axis sequence of float

The rotor axis direction.

required
radius float

The rotor tip radius, in the lines' unit.

required
reach float

The largest axial distance of a blade trailing edge from the hub plane.

required

Returns:

Type Description
ndarray

One bool per line, True for a rotor line.

pyflightstream.farfield.sample_area_coverage

sample_area_coverage(
    integrand: ndarray, fields: LatticeFields
) -> np.ndarray

Fraction of the plane's AREA that was sampled, per leading index.

Each sample stands for the annular cell its quadrature weight (:func:ring_sample_weights) integrates, so a missing sample at the rim, which stands for far more of the disc than one at the hub, costs what the integral loses by it. A count (:func:sample_coverage) would report the same 0.99 for a hole at the hub and for a hole at the rim whose cost in the integral is many times larger.

Parameters:

Name Type Description Default
integrand ndarray

Any array whose two trailing axes are (n_r, n_psi).

required
fields LatticeFields

The survey whose ring edges give each ring's represented area. Its ring count must be the integrand's n_r.

required

Returns:

Type Description
ndarray

Area coverage in [0, 1]; 1.0 means every sample is finite.

Raises:

Type Description
FarfieldInputError

If fields has another number of rings than the integrand.

pyflightstream.farfield.sample_coverage

sample_coverage(integrand: ndarray) -> np.ndarray

Fraction of (r, psi) samples that are finite, per leading index.

The diagnostic half of PYFS-010: :func:plane_integral returns NaN when any sample is missing, which says THAT a plane is unusable and not how far off it is; this says how much of the plane was actually sampled.

THIS IS A COUNT OF SAMPLES, every sample weighing the same. On an annular lattice the samples stand for very different areas, so a missing sample at the rim costs the integral far more than one at the hub and the count reports them alike: use :func:sample_area_coverage for the fraction of the plane that was sampled (PFS-2019.01).

Parameters:

Name Type Description Default
integrand ndarray

Any array whose two trailing axes are (n_r, n_psi).

required

Returns:

Type Description
ndarray

Coverage in [0, 1]; 1.0 means every sample is finite.

pyflightstream.farfield.shaft_torque

shaft_torque(
    fields: LatticeFields, rho: float
) -> np.ndarray

Swirl flux integral(rho (r v_theta) u dA) per station (N m).

The order-0 v_theta content weighted by the dimensional moment arm r (DLV-006 Sec. 3.4); the sign follows the v_theta convention of :func:~pyflightstream.farfield.fields.cylindrical_components.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples in the shaft-aligned axes of :mod:pyflightstream.probes.lattice, with the units of :class:~pyflightstream.farfield.fields.LatticeFields.

required
rho float

Density in kg/m3.

required

Returns:

Type Description
ndarray

Shaft torque flux in N m for each station.

pyflightstream.farfield.sheet_crossings

sheet_crossings(
    lines: Sequence[ndarray],
    values: ndarray,
    sheet: WakeSheet,
    x_t: float,
) -> SheetCrossings

Cut one sheet's lines at their first crossing of the plane x = x_t.

Parameters:

Name Type Description Default
lines sequence of numpy.ndarray

Wake chains in wind axes, in metres, newest node first.

required
values ndarray

One filament strength per chain in m^2/s.

required
sheet WakeSheet

Indices and topology of the selected sheet.

required
x_t float

Downstream plane position in metres.

required

Returns:

Type Description
SheetCrossings

First crossings in sheet order and the count not reaching the plane.

pyflightstream.farfield.sheet_forces

sheet_forces(
    sheets: Sequence[SheetCrossings],
    *,
    rho: float,
    v_inf: float,
    mirror: bool = False,
) -> TraceResult

Lift, side force and induced drag of several wake sheets on one plane (FR-452).

Each sheet's strips lie between its consecutive crossings (around the ring for a closed sheet); the circulation of a strip is minus the running sum of the exported values from the sheet's first crossing, and a ring's has its mean removed to make the walk's start irrelevant. Blades sum inward from their free tip. Mirror sheets reflect once. The normalwash at each strip comes from the filaments of every sheet, and

L = rho V sum Gamma dy, Y = -rho V sum Gamma dz, D_i = -(rho / 2) sum Gamma v_n ds.

On one open sheet this is :meth:~pyflightstream.farfield.trefftz.WakeTrace.forces.

Parameters:

Name Type Description Default
sheets sequence of SheetCrossings

The crossings of each sheet.

required
rho float

Density in kg/m3 and free-stream speed in m/s.

required
v_inf float

Density in kg/m3 and free-stream speed in m/s.

required
mirror bool

The sheets are one half of a mirror model.

False

Returns:

Type Description
TraceResult

The joint forces, the per-sheet forces (sheet_lift, sheet_drag_share under every sheet's filaments, sheet_drag_isolated under the sheet's own) and the strips; the image of a mirrored sheet carries its sheet's label.

Raises:

Type Description
FarfieldInputError

If the sheets do not form an integrable trace.

pyflightstream.farfield.split_wake_sheets

split_wake_sheets(
    lines: Sequence[ndarray],
    values: ndarray,
    *,
    mirror: bool = False,
) -> tuple[list[WakeSheet], list[tuple[np.ndarray, str]]]

Separate the wake lines into sheets by their first nodes (FR-452).

A sheet is a run of first nodes in which each is close to the next, close meaning within :data:~pyflightstream.farfield.trefftz.RUN_GAP_FACTOR times the smaller of the two nearest-neighbour distances, so a dense rim is never taken into a sparse trailing edge. An open sheet is walked from its end farthest from the symmetry plane to its end nearest it (y of the first node; the end of a full model's sheet is the one of smaller y). A run that closes on itself is a ring: the first nodes lie on a rim, as they do at a base.

Parameters:

Name Type Description Default
lines sequence of numpy.ndarray

The wake lines, each (n_k, 3), from the trailing edge downstream.

required
values ndarray

One value per line.

required
mirror bool

The lines are one half of a mirror model, so the end nearest y = 0 is the root.

False

Returns:

Name Type Description
sheets list of WakeSheet

The sheets that can be traced.

left_out list of (numpy.ndarray, str)

The lines of every group that cannot, with the reason.

pyflightstream.farfield.spurious_diagnostic

spurious_diagnostic(
    near_field: float,
    far_field: float,
    *,
    rho_inf: float,
    v_inf: float,
    s_ref: float,
) -> float

Inviscid near-field minus far-field load, in counts (gate G4).

The residual between the integrated inviscid near-field load and the far-field balance is treated as numerical, not physical (design note DLV-006 Sec. 3.5; no dated report measures it); reported in counts so runs are comparable across cases and solvers.

Parameters:

Name Type Description Default
near_field float

Integrated inviscid near-field force in N (total minus viscous projection).

required
far_field float

Far-field force balance in N.

required
rho_inf float

Free-stream density in kg/m3.

required
v_inf float

Free-stream speed in m/s.

required
s_ref float

Reference area in m2 used by the load coefficients.

required

Raises:

Type Description
TypeError

If s_ref is omitted: the reference area in m2 has no safe default.

Returns:

Type Description
float

Near-field minus far-field force expressed in drag counts.

pyflightstream.farfield.strip_edges

strip_edges(
    positions: ndarray,
    *,
    ends: Literal["station", "extended"] = "extended",
) -> np.ndarray

Return the edges of the strips around the stations of a trace.

Between two stations the edge is their midpoint. Beyond the end stations:

  • "extended" (the far field, FR-1012): half the adjacent spacing further out, so n uniform stations at the centers of n equal strips tile exactly the extent the solver divided;
  • "station": the end stations themselves, so the strips stop at the end stations and the span is shortened by half a spacing at each end; the integrated sectional loads of the sections table use the "extended" rule too, as the definitions page states.

Parameters:

Name Type Description Default
positions ndarray

Station positions (one coordinate) in the order of the trace, shape (n,), n >= 2; the edges of a trace in (y, z) are this rule applied to each coordinate. A coordinate may be constant or descending; no coordinate monotonicity is required. Nonfinite coordinates propagate through the midpoint and endpoint arithmetic without validation.

required
ends ('extended', 'station')

The rule beyond the end stations.

"extended"

Returns:

Type Description
ndarray

The n + 1 strip edges, in the order of positions.

Raises:

Type Description
FarfieldInputError

If positions is not one-dimensional with at least two stations, or ends is neither "extended" nor "station".

pyflightstream.farfield.symmetry_floor

symmetry_floor(
    values: ndarray,
    *,
    psi: ndarray,
    m_max: int = 6,
    excluded_orders: Sequence[int] = (),
) -> float

Largest azimuthal harmonic magnitude above order zero (gate G3).

At zero incidence every retained m >= 1 harmonic must vanish to the numerical floor; the recorded floor becomes the detectability threshold for the nonzero-incidence step (DLV-006 Sec. 3.2).

Returns:

Type Description
float

max_{m>=1} |c_m| over every other index, in field units; NaN where any sample is missing.

Parameters:

Name Type Description Default
values ndarray

Sampled values with azimuth along the last dimension.

required
psi ndarray

Uniform full-turn azimuth coordinates in radians.

required
m_max int

Highest azimuthal harmonic order to retain, at least 1.

6
excluded_orders sequence of int

Orders omitted from the floor, such as multiples of a rotor's blade count. If no order remains, the floor is NaN rather than a measured zero.

()

Raises:

Type Description
FarfieldInputError

If the azimuth grid or the order is invalid, or m_max is below 1.

pyflightstream.farfield.to_counts

to_counts(
    delta: float,
    *,
    rho_inf: float,
    v_inf: float,
    s_ref: float,
) -> float

Express a force delta in drag counts.

One count is 1e-4 of the dynamic-pressure force scale: counts = 2 delta / (rho_inf v_inf^2 s_ref) * 1e4.

Parameters:

Name Type Description Default
delta float

Force difference (N).

required
rho_inf float

Free-stream density (kg/m3) and speed (m/s).

required
v_inf float

Free-stream density (kg/m3) and speed (m/s).

required
s_ref float

Explicit reference area (m2), the same area used by the load coefficients.

required

Raises:

Type Description
TypeError

If s_ref is omitted: the reference area in m2 has no safe default.

FarfieldInputError

If density, speed or area is not finite and strictly positive. Dynamic-pressure counts are undefined in hover; retain dimensional loads there.

Returns:

Type Description
float

Force delta expressed in drag counts.

pyflightstream.farfield.trace_coefficients

trace_coefficients(
    lift: float,
    *,
    side_force: float,
    induced_drag: float,
    q: float,
    s_ref: float,
    b_ref: float,
) -> dict[str, float]

Return the coefficients CL_T, CY_T, CDI_T, E_T and AR of a result.

CL_T = L / (q SREF) and likewise, AR = BREF^2 / SREF and E_T = CL_T^2 / (pi AR CDI_T), NaN where CDI_T is zero or not finite or a reference value is missing.

Parameters:

Name Type Description Default
lift float

Lift force in N.

required
side_force float

Side force in N.

required
induced_drag float

Induced drag force in N.

required
q float

Free-stream dynamic pressure in Pa.

required
s_ref float

Reference area in m2 used by the load coefficients.

required
b_ref float

Reference span in m.

required

Returns:

Type Description
dict[str, float]

Trefftz coefficients and aspect ratio, with NaN for undefined values.

pyflightstream.farfield.trace_forces

trace_forces(
    y: ndarray,
    *,
    z: ndarray,
    gamma: ndarray,
    rho: float,
    v_inf: float,
    sheets: Sequence[int] | ndarray | None = None,
    ends: Literal["extended", "station"] = "extended",
    mirror: bool = False,
) -> TraceResult

Lift, side force and induced drag of a discrete trace (Trefftz A and B).

The trace is a list of points (y, z) in the Trefftz plane, in wind axes (m), each carrying the circulation of the strip around it, grouped in sheets and ordered along each sheet. Strip edges follow :func:~pyflightstream.farfield.quadrature.strip_edges; a filament leaves every edge with the circulation shed there; the normalwash at each point is induced by every sheet's filaments; and

L = rho V sum Gamma dy, Y = -rho V sum Gamma dz, D_i = -(rho / 2) sum Gamma v_n ds.

Parameters:

Name Type Description Default
y ndarray

The trace points, m, shape (n,).

required
z ndarray

The trace points, m, shape (n,).

required
gamma ndarray

Circulation of each strip, m^2/s (positive for positive lift on a sheet running toward +y).

required
rho float

Density (kg/m3) and free-stream speed (m/s).

required
v_inf float

Density (kg/m3) and free-stream speed (m/s).

required
sheets sequence of int

Sheet label per point; one sheet when omitted. Each sheet is traced in the order its points are given.

None
ends ('extended', 'station')

The strip-edge rule beyond the end points; the far field uses "extended" (FR-1012).

"extended"
mirror bool

Mirror each sheet about the plane y = 0 before the integral (a half model, FR-1014); the inner edge of the innermost strip then lies on the plane.

False

Returns:

Type Description
TraceResult

The forces of the traced configuration and the per-strip arrays.

Raises:

Type Description
FarfieldInputError

If trace samples, density, symmetry or integration settings are invalid.

pyflightstream.farfield.transverse_flux

transverse_flux(
    fields: LatticeFields,
    rho: float,
    *,
    component: str = "w",
    method: str = "quadrature",
) -> np.ndarray

Transverse momentum flux integral(rho u c dA) per station (N).

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples.

required
rho float

Density (kg/m3).

required
component str

Transverse velocity component: "w" (+z) for the F_Z / M_Y balance, "v" (+y) for F_Y / M_Z.

'w'
method str

"quadrature" is the direct product integral; "harmonic" evaluates the same number from the azimuthal spectra of u and the component (Parseval), the second, independent code path DLV-006 Sec. 3.3 demands.

'quadrature'

Returns:

Type Description
ndarray

Transverse momentum flux in N for each station.

Raises:

Type Description
FarfieldInputError

If the integration method is unsupported.

pyflightstream.farfield.transverse_force

transverse_force(
    fields: LatticeFields,
    rho: float,
    *,
    inlet: float,
    outlet: float,
    component: str = "w",
    lateral_flux: float = 0.0,
) -> TransverseForce

Transverse force with the lateral term reported separately (N).

F_Z = integral_out(rho u w dA) - integral_in(rho u w dA) + Delta_lat (DLV-006 Sec. 3.3). The lateral-cylinder momentum and pressure flux is never folded silently into the plane term: it is a separate value of the result, zero only when zero incidence makes it so.

Parameters:

Name Type Description Default
fields LatticeFields

Survey samples.

required
rho float

Density (kg/m3).

required
inlet float

Station coordinates x/R of the bounding planes.

required
outlet float

Station coordinates x/R of the bounding planes.

required
component str

"w" for F_Z, "v" for F_Y.

'w'
lateral_flux float

Lateral-surface momentum-plus-pressure flux (N), from :func:lateral_flux; the default 0.0 is legitimate only at zero incidence, where symmetry nulls it.

0.0

Returns:

Type Description
TransverseForce

Plane, lateral and total force terms in N.

pyflightstream.farfield.wake_crossings

wake_crossings(
    lines: Sequence[ndarray], *, values: ndarray, x_t: float
) -> WakeTrace

Cut each wake line at its first crossing of the plane x = x_t (FR-452).

Each line is an ordered chain of nodes (n_k, 3) in wind axes (m), from the trailing edge downstream. A line is cut at its first crossing by linear interpolation on the straddling segment; the crossings are ordered by the span position (y) of their lines' starting nodes, not by where they cross, so a rolled-up sheet keeps its topology.

Parameters:

Name Type Description Default
lines sequence of numpy.ndarray

The wake lines.

required
values ndarray

One value per line.

required
x_t float

The plane's position along the free stream, m.

required

Returns:

Type Description
WakeTrace

The crossings, or a problem naming why there is no trace: a line that ends before the plane (short counts them), starting nodes that share a span position, or a gap in the run of starting nodes larger than :data:RUN_GAP_FACTOR times their median gap.

Raises:

Type Description
FarfieldInputError

If a wake polyline or its values have an invalid shape.

pyflightstream.farfield.wake_rotor_loads

wake_rotor_loads(
    lines: Sequence[ndarray],
    *,
    values: ndarray,
    hub: Sequence[float],
    axis: Sequence[float],
    omega: float,
    v_axial: float,
    rho: float,
    blades: int,
) -> WakeLoads

Thrust and torque of a rotor from its shed wake lines (Kutta-Joukowski).

The lines are split per blade at the azimuth gaps of their first nodes and ordered root to tip. The bound circulation of the strip between lines j and j + 1 is the accumulated shed circulation from the root, Gamma_j = sum_{k <= j} value_k. It equals the tip sum of Trefftz B, -sum_{k > j} value_k, when a blade's values close (sum zero); the solver's rotor lattice does not close at the tip, whose filament carries part of the circulation, so the root anchor keeps every strip. Line k is a chain of straight vortex segments of strength -value_k along the line. At the strip's lifting-line point (the midpoint of the two first nodes) the induced velocity w of every line (Biot-Savart) gives dT = rho Gamma (Omega r - w_t) dr and dQ = rho Gamma (V_a + w_a) r dr, with e_t = e_a x e_r. No scale is applied: the values are read as the circulation itself.

Where fewer blades carry lines than blades (a periodic sector), the lines are copied about the axis by the sector angle, so the induced field and the sums are those of the whole rotor.

Parameters:

Name Type Description Default
lines sequence of numpy.ndarray

The rotor's wake lines, (n_k, 3) each, in metres, first node on the trailing edge.

required
values ndarray

The shed circulation of each line, m^2/s.

required
hub sequence of float

Hub origin (m) and rotor axis direction.

required
axis sequence of float

Hub origin (m) and rotor axis direction.

required
omega float

Rotor speed about axis, rad/s, signed.

required
v_axial float

Free-stream component along axis, m/s.

required
rho float

Density, kg/m^3.

required
blades int

The rotor's blade count, periodic copies included.

required

Returns:

Type Description
WakeLoads

Thrust, torque, the blades traced and the lines read.

Raises:

Type Description
FarfieldInputError

If the density is invalid, the rotor sheds no wake line, the shed values do not match the lines, or no blade sheds two lines or more.