Skip to main content

SupersonicBody

Struct SupersonicBody 

Source
#[non_exhaustive]
pub struct SupersonicBody { pub covered: usize, pub join_start_mach: f64, pub shape_weight: f64, /* private fields */ }
Expand description

The second-order shock-expansion method’s share of each body component it covers, tabulated in Mach, and where it joins slender-body theory (the decision record on flying it, ADR-034).

The method (crate::shock_expansion) covers a pointed nose, the cylinders straight behind it, and boattails and cylinders behind those, up to the first other body (a flare), step in radius or gap. It flies only if no body after them has a potential-flow slope of its own (a flare, a step). A boattail doesn’t take slender-body theory’s share: the method’s nose and cylinder beside slender-body theory’s boattail would put the body’s center of pressure further off than slender-body theory alone (milestone M1.8e4). By default (SupersonicBoattail::WashingtonPettis) it takes the share the method gives a cylinder of its length and fore radius in its place, plus Washington and Pettis’s measured increment at their center of pressure (crate::supersonic_boattail); SupersonicBoattail::Footnote8 keeps the method’s own, TN 3527 footnote 8. Cylinders behind a boattail take the method’s shares either way. A boattail’s share, and a cylinder’s behind it, may cross zero, so those parts keep slender-body theory’s station (AeroModel::component_station_m).

The method is too slow to run at each step of a flight, so AeroModel::supersonic_body tabulates each covered segment’s slope and moment every 0.05 in Mach, from Mach 5 down to the lowest Mach from which the method holds, and a flight interpolates linearly between rows. Where the method stops holding above SUPERSONIC_JOIN_START_MACH, bisection finds that Mach to the last bit of an f64 and the table gains a row there, so the join’s start moves with the body’s shape rather than in 0.05 steps. The join starts at that Mach, or at SUPERSONIC_JOIN_START_MACH if higher: at Mach M, a covered component’s potential-flow slope and moment, and a nose’s or cylinder’s station, are slender-body theory’s plus w (shock-expansion − slender-body), w = SupersonicBody::weight(M): the join’s own (M − M_join)/SUPERSONIC_JOIN_WIDTH_MACH clamped to [0, 1], times SupersonicBody::shape_weight, which is 1 unless a lip rides along only partly inside its boattail’s wake. Everything is linear in Mach and in that share of shape, so nothing jumps.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§covered: usize

How many body components the method covers: the first entries of AeroModel::bodies. The last of them may be lips in a covered boattail’s wake, which the method doesn’t march: the method gives them nothing at any Mach number, so what such a lip carries is (1 − SupersonicBody::weight(M)) of slender-body theory’s share, none of it above the join where the wake covers it wholly (crate::drag::WakeTerm; the decision record on the lip, ADR-039).

§join_start_mach: f64

The Mach number where the join starts; the shares count in full from SUPERSONIC_JOIN_WIDTH_MACH above it.

§shape_weight: f64

How much of the method the body’s shape takes, in (0, 1], which multiplies the join’s weight: below 1 where a lip rides along only partly inside its boattail’s wake (crate::drag::WakeTerm, issue #87: the body’s normal force jumps with small changes of shape, ADR-041: a lip’s shelter weighed, not switched). Slender-body theory takes the rest, so a lip drawn a hair taller moves the body between the models continuously instead of switching it.

Implementations§

Source§

impl SupersonicBody

Source

pub fn weight(&self, mach: f64) -> f64

How much of the method the body takes at mach, in [0, 1]: the join’s own weight, 0 at Self::join_start_mach and below and 1 from SUPERSONIC_JOIN_WIDTH_MACH above it, times Self::shape_weight. Slender-body theory takes the rest, so this is the single definition of how the two models blend.

Source

pub fn share(&self, index: usize, mach: f64) -> Option<(f64, f64)>

Covered component index’s share at mach, interpolated linearly between rows (clamped to the table’s ends): slope per radian and moment about the nose tip, m per radian. A boattail’s share, and a cylinder’s behind it, may be negative or cross zero, so their moment over slope need not lie on the part.

Trait Implementations§

Source§

impl Clone for SupersonicBody

Source§

fn clone(&self) -> SupersonicBody

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SupersonicBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SupersonicBody

Source§

fn eq(&self, other: &SupersonicBody) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SupersonicBody

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SupersonicBody

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.