Skip to main content

DeviceDrag

Enum DeviceDrag 

Source
#[non_exhaustive]
pub enum DeviceDrag { DragArea { cd_s_m2: f64, }, Streamer { length_m: f64, width_m: f64, surface_density_kg_m2: f64, model: StreamerModel, }, Tumble { drag_area_m2: f64, body_profile_m2: f64, fin_area_m2: f64, }, Canopy { nominal_diameter_m: f64, drag_coefficient: f64, kind: Option<CanopyType>, }, }
Expand description

What gives a device its drag area C_D S.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

DragArea

A drag area given directly, m² (RocketPy’s cd_s).

Fields

§cd_s_m2: f64

C_D S, m².

§

Streamer

A streamer: a strip of fabric length_m by width_m, whose drag area comes from model (StreamerModel).

Fields

§length_m: f64

Its length l, m.

§width_m: f64

Its width w, m.

§surface_density_kg_m2: f64

The fabric’s surface density, kg/m² (StreamerModel::OpenRocket uses it).

§model: StreamerModel

Which correlation gives its drag area.

§

Tumble

A body descending broadside, tumbling, with no device open: the drag area of its body tubes and fins. Build it with DeviceDrag::tumbling, which computes it from the airframe.

Fields

§drag_area_m2: f64

The drag area C_D S, m².

§body_profile_m2: f64

The body’s side profile area, m² (for reports; it and the fin area have to add up to the drag area through the model’s two coefficients, so a file that leaves one out is refused by serde rather than silently defaulting to an inconsistent device).

§fin_area_m2: f64

The effective fin area, m² (for reports).

§

Canopy

A canopy of nominal diameter D₀ with C_D0 on the nominal area S₀ = π D₀²/4 (Knacke’s convention, printed page 5-2).

Fields

§nominal_diameter_m: f64

The nominal diameter D₀, m.

§drag_coefficient: f64

C_D0 on S₀.

§kind: Option<CanopyType>

The canopy type, where it is one of Knacke’s.

Implementations§

Source§

impl DeviceDrag

Source

pub fn tumbling(assembly: &Assembly) -> Result<Self, SimError>

The drag area of assembly tumbling: C_D,f A_f + C_D,bt A_bt (the OpenRocket technical documentation v13.05, §3.5, eq. 3.98 and 3.99, printed pages 53 to 55).

  • A_bt is the body’s side profile area, the integral of its outer diameter along the axis, ∫ d dx, taken over each body component’s own profile (a curved nose’s or transition’s by quadrature, hpr_design::revolve). Shoulders are inside the airframe and add nothing.
  • A_f is, for each fin set, one fin’s planform area times the efficiency factor for its fin count (TUMBLE_FIN_EFFICIENCY). Launch lugs and rail buttons add nothing, and an airframe with tube fins is refused: they are a large part of its broadside area and the model has no factor for them.
  • A pod’s body components and fins count as the airframe’s do, once per pod: the documentation’s model has no term for them, and none for one part shading another.

It sums every stage, so it is the whole stack tumbling. For a spent booster on its own, which is what the documentation’s model was written for, use Self::tumbling_stages with that body’s stages.

The constants were fitted to 22 m drop tests of five models 44 to 103 mm across and 6.8 to 160 g, descending at 5.0 to 6.6 m/s, and predict those terminal velocities within 3 to 14%. Bodies much larger or faster than that are outside the fit: above a Reynolds number of about 3e5 a cylinder’s crossflow drag falls by roughly half (docs/physics/recovery.md).

§Errors

SimError::Design if a fin planform’s area or a nose cone’s or transition’s profile can’t be computed, and SimError::Domain if the airframe presents no area at all, carries tube fins, or has a fin set of more than the eight fins Table 3.4 covers.

Source

pub fn tumbling_stages( assembly: &Assembly, (first, last): (usize, usize), ) -> Result<Self, SimError>

The drag area of the stages first..=last of assembly tumbling on their own, which is what a separated body does (Separation). Self::tumbling is this over every stage. It covers whole stages only: for an ejected piece that is part of a stage (crate::Ejection) use crate::Simulation::tumbling_piece, which sums the piece’s own components.

§Errors

As Self::tumbling.

Source

pub const fn streamer( length_m: f64, width_m: f64, surface_density_kg_m2: f64, ) -> Self

A streamer length_m by width_m of a fabric of surface_density_kg_m2, by the default model (StreamerModel::Filippone).

Source

pub const fn canopy(kind: CanopyType, nominal_diameter_m: f64) -> Self

A canopy of nominal_diameter_m with its type’s default C_D0 (CanopyType::drag_coefficient).

Source

pub fn drag_area_m2(&self) -> f64

The fully open drag area C_D S, m².

Source

pub const fn nominal_diameter_m(&self) -> Option<f64>

The nominal diameter D₀, m, where the device has one.

Source

pub const fn canopy_type(&self) -> Option<CanopyType>

The canopy type, where the device has one.

Trait Implementations§

Source§

impl Clone for DeviceDrag

Source§

fn clone(&self) -> DeviceDrag

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 Copy for DeviceDrag

Source§

impl Debug for DeviceDrag

Source§

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

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

impl<'de> Deserialize<'de> for DeviceDrag

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for DeviceDrag

Source§

fn eq(&self, other: &DeviceDrag) -> 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 DeviceDrag

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 DeviceDrag

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.