Skip to main content

BodyGeometry

Struct BodyGeometry 

Source
#[non_exhaustive]
pub struct BodyGeometry { pub length_m: f64, pub fore_area_m2: f64, pub aft_area_m2: f64, pub volume_m3: f64, pub planform_area_m2: f64, pub planform_centroid_m: f64, pub aft_angle_rad: f64, }
Expand description

The aerodynamic geometry of one body component, in its own frame (fore end at 0, stations positive aft).

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.
§length_m: f64

Length, m.

§fore_area_m2: f64

Cross-section area at the fore end, m².

§aft_area_m2: f64

Cross-section area at the aft end, m².

§volume_m3: f64

Volume enclosed by the outer surface, m³.

§planform_area_m2: f64

Side-view (planform) area, m².

§planform_centroid_m: f64

Centroid of the planform area, m aft of the fore end.

§aft_angle_rad: f64

Angle of the outer surface to the axis at the aft end, atan(dr/dx), rad: positive where the radius grows aft, and ±π/2 where the profile ends in a blunt tip (the aft end of a narrowing elliptical or Haack transition).

Implementations§

Source§

impl BodyGeometry

Source

pub fn cylinder(length_m: f64, radius_m: f64) -> Result<Self, AeroError>

A cylinder of radius_m and length_m.

§Errors

AeroError::Domain for a non-positive or non-finite dimension.

Source

pub fn from_profile(profile: &Profile) -> Result<Self, AeroError>

A nose cone’s or transition’s geometry from its outer profile, filled (hpr_design::revolve).

§Errors

Numerical errors from the volume integral, and AeroError::Domain if the result is out of range.

Source

pub fn validate(&self) -> Result<(), AeroError>

Checks that every field is finite and in range.

§Errors

AeroError::Domain for a non-finite or negative value, or a length, volume or planform area that isn’t positive.

Source

pub fn normal_force_slope(&self, reference_area_m2: f64) -> f64

Normal-force slope at α → 0, per radian: (C_Nα)_B = (2/A_ref)[A(l) − A(0)] (Barrowman 1967 eq. 3-65; Niskanen 2009 eq. 3.19). Negative for a boattail.

Source

pub fn moment_slope_m(&self, reference_area_m2: f64) -> f64

Moment slope about the fore end at α → 0, m per radian: (C_Nα)_B X_B = (2/A_ref)[l A(l) − V] (Niskanen 2009 eq. 3.25 times the reference length).

Source

pub fn center_of_pressure_m(&self) -> Option<f64>

Center of pressure of the potential-flow term, m aft of the fore end: X_B = [l A(l) − V] / [A(l) − A(0)] (Barrowman 1966 eq. 28; Niskanen 2009 eq. 3.28). None when the two end areas are equal, where the body has no potential-flow normal force.

Source

pub fn lift_coefficient( &self, reference_area_m2: f64, alpha_rad: f64, factor: f64, ) -> f64

The body-lift normal-force coefficient at alpha_rad with factor factor: C_N = factor · (A_plan/A_ref) sin² α (Niskanen 2009 eq. 3.26), acting at BodyGeometry::planform_centroid_m (eq. 3.27). The factor is crate::crossflow::BodyLift::factor’s: Jorgensen’s η C_dn, or Galejs’s BODY_LIFT_K.

Trait Implementations§

Source§

impl Clone for BodyGeometry

Source§

fn clone(&self) -> BodyGeometry

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 BodyGeometry

Source§

impl Debug for BodyGeometry

Source§

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

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

impl<'de> Deserialize<'de> for BodyGeometry

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 BodyGeometry

Source§

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

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 BodyGeometry

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.