#[non_exhaustive]pub struct MassRelease {
pub trigger: Trigger,
pub component: String,
pub drag_area_m2: f64,
}Expand description
A part carried inside the airframe that leaves it on trigger, and then falls to the ground
on its own under drag_area_m2.
The part is an internal component named by its id, and it leaves with everything inside it.
It can’t be a body component or an external one, one copy of a cluster’s, or hold a motor.
Its mass can’t be under an override: not its stage’s, and not one on a component around it
that covers what that component holds, since the override doesn’t say how much of the mass is
the part’s. Its stage can’t carry an added mass (hpr_design::AddedMass) either: that isn’t
flown yet. It must have mass, and leave the airframe some, motors aside. A part can be released
once, and not from inside another part that is released.
The drag area C_D S is the part’s own once it is out, m²: a tumbling weight’s, or its
parachute’s taken as open at once. It must be positive: a part with none would fall as if in a
vacuum, which is a wrong number rather than a model.
A release can’t come before the rocket leaves the rail: the part has nowhere to go on the pad.
use hpr_sim::{MassRelease, Trigger};
// The part with id "payload" leaves at apogee and falls under 0.3 m² of parachute.
let release = MassRelease::new(Trigger::Apogee, "payload", 0.3);
assert_eq!(release.drag_area_m2, 0.3);Give it to a flight with crate::Simulation::with_releases.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.trigger: TriggerWhen the part leaves: the same triggers as a recovery device’s.
component: StringThe id of the internal component that leaves.
drag_area_m2: f64The part’s own drag area C_D S once it is out, m²: positive.
Implementations§
Trait Implementations§
Source§impl Clone for MassRelease
impl Clone for MassRelease
Source§fn clone(&self) -> MassRelease
fn clone(&self) -> MassRelease
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MassRelease
impl Debug for MassRelease
Source§impl<'de> Deserialize<'de> for MassRelease
impl<'de> Deserialize<'de> for MassRelease
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MassRelease
impl PartialEq for MassRelease
Source§fn eq(&self, other: &MassRelease) -> bool
fn eq(&self, other: &MassRelease) -> bool
self and other values to be equal, and is used by ==.