pub struct GustField { /* private fields */ }Expand description
A precomputed Dryden turbulence realization along a path coordinate, sampled every spacing
meters and interpolated linearly, so it is a pure function an adaptive integrator can call
repeatedly.
Axes. u is the longitudinal component: the Dryden spectrum it carries belongs to the
velocity component along the path through the frozen field, and v and w are the two
transverse ones. MIL-F-8785C (p. 60) puts u along the horizontal relative mean wind for
aircraft at low altitude, but for a climbing rocket the path is nearly vertical, so the caller
must align u with the path. Getting that wrong does change the statistics: a horizontal gust
given the longitudinal spectrum has twice the transverse power at low frequency and 2/3 of it at
high frequency. The signs of the axes do not matter.
Path coordinate. The field does not decide what s is: distance flown through the air is
Taylor’s hypothesis, but a caller may key it on altitude or on time at a reference speed.
Linear interpolation removes variance at wavelengths near the spacing, so keep the spacing
well below the smallest scale length (a tenth or less).
It serializes as its spacing and samples, and re-checks them when deserialized.
Implementations§
Source§impl GustField
impl GustField
Sourcepub fn generate(
seed: u64,
parameters: &DrydenParameters,
length_m: f64,
spacing_m: f64,
) -> Result<Self, AtmosError>
pub fn generate( seed: u64, parameters: &DrydenParameters, length_m: f64, spacing_m: f64, ) -> Result<Self, AtmosError>
A field covering at least length_m (rounded up to a whole number of spacings), with
samples every spacing_m and constant parameters.
§Errors
Sourcepub fn generate_with(
seed: u64,
length_m: f64,
spacing_m: f64,
parameters: impl FnMut(f64) -> Result<DrydenParameters, AtmosError>,
) -> Result<Self, AtmosError>
pub fn generate_with( seed: u64, length_m: f64, spacing_m: f64, parameters: impl FnMut(f64) -> Result<DrydenParameters, AtmosError>, ) -> Result<Self, AtmosError>
A field whose parameters vary along the path: parameters(s) is evaluated at each sample
point s = k·spacing and held over the step that ends there (the first sample uses
parameters(0)).
§Errors
AtmosError::Domainif the length is negative or not finite, the spacing is not finite and positive, or the field would need more thanMAX_GUST_FIELD_SAMPLES.- Any error
parametersreturns.
Sourcepub fn gust(&self, distance_m: f64) -> Result<GustSample, AtmosError>
pub fn gust(&self, distance_m: f64) -> Result<GustSample, AtmosError>
The gust at path coordinate distance_m, linearly interpolated; beyond either end the end
sample is held and flagged.
§Errors
AtmosError::Domain if the distance is not finite.