pub struct Separation {
pub trigger: Trigger,
pub after_stage: usize,
pub drops_burning: bool,
}Expand description
A separation: the stack comes apart at a stage boundary and every body descends under its own
devices (docs/physics/recovery.md, and the decision record on separation, ADR-014).
Bodies are contiguous runs of stages. Stages 0..=after_stage keep the nose and are body 0;
the stages aft of the split are body 1. Each body flies as a point mass from the separation,
with the mass properties of its own stages and motors, so every body must carry at least one
device: the descent phase has no airframe drag (the decision record on recovery,
ADR-012), and a body with nothing open would fall as if in a vacuum.
A separation is an ideal one: no impulse, so each body leaves with the velocity its own center
of mass already had. The aft body’s motors must have burned out by then, because a body’s
mass is taken as constant through its descent, unless the separation may drop one burning
(Separation::drops_burning). When the nose’s body still has a motor to burn,
it is a sustainer: it flies on as a rigid body on its own stages’ aerodynamics, and only the aft
body descends as a point mass (the decision record on staging, ADR-074).
Fields§
§trigger: TriggerWhen the stack comes apart.
after_stage: usizeThe last stage that stays with the nose. Stages after it form the aft body.
drops_burning: boolWhether, when it is powered (Self::powered_at), it may drop a motor that still burns,
as OpenRocket’s first burnout of a stage drops the stage’s other motors (the decision
record on a stage’s first burnout, ADR-172). The dropped body’s descent is a point
mass with no thrust, so it leaves out the impulse that motor had left
(BodyFlight::impulse_left_n_s). Off by default: then the aft body’s motors must have
burned out by the separation. A motor still to light is refused either way, and so is any
in an unpowered separation’s aft body.
Implementations§
Source§impl Separation
impl Separation
Sourcepub const fn new(trigger: Trigger, after_stage: usize) -> Self
pub const fn new(trigger: Trigger, after_stage: usize) -> Self
A separation at the boundary after after_stage, on trigger.
Sourcepub const fn dropping_burning(self) -> Self
pub const fn dropping_burning(self) -> Self
The same separation, let drop a motor that still burns when it is powered
(Self::drops_burning).
Sourcepub const fn stages_of(
&self,
index: usize,
stage_count: usize,
) -> Option<(usize, usize)>
pub const fn stages_of( &self, index: usize, stage_count: usize, ) -> Option<(usize, usize)>
The stages of body index: body 0 keeps the nose, body 1 is the rest. None when there
is no such body, including when the boundary is at or past the last stage.
Sourcepub fn powered_at(&self, assembly: &Assembly, time_s: f64) -> bool
pub fn powered_at(&self, assembly: &Assembly, time_s: f64) -> bool
Whether it is powered when it fires at time_s, as the flight decides for the first
separation it flies: a motor of the nose’s body (stages 0..=after_stage) burns then, or
lights later at a known time, counting one this separation lights. A powered separation’s
nose body flies on as a rigid body on its own stages’ aerodynamics (the decision record on
staging, ADR-074); an unpowered one’s descends as a point mass with only its
devices’ drag, as every body does (the decision record on separation, ADR-014).
Sourcepub fn body_of(separations: &[Self], stage: usize) -> usize
pub fn body_of(separations: &[Self], stage: usize) -> usize
The body stage stage rides once every one of separations (in the order they fire, as
crate::Simulation::with_separations takes them) has fired: body k + 1 for the first
separation k it is aft of, the part that separation drops; body 0, the nose’s, for a
stage aft of none.
Sourcepub fn stages_of_body(
separations: &[Self],
body: usize,
stage_count: usize,
) -> Option<(usize, usize)>
pub fn stages_of_body( separations: &[Self], body: usize, stage_count: usize, ) -> Option<(usize, usize)>
The stages of body body once every one of separations has fired, in a design of
stage_count stages: body 0 keeps the nose, and body k + 1 is the stages separation k
drops, from its boundary back to the one behind it (or the tail). None when there is no
such body, including when a boundary is at or past the last stage, or the boundaries don’t
move forward in the order given.
Trait Implementations§
Source§impl Clone for Separation
impl Clone for Separation
Source§fn clone(&self) -> Separation
fn clone(&self) -> Separation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Separation
Source§impl Debug for Separation
impl Debug for Separation
Source§impl<'de> Deserialize<'de> for Separation
impl<'de> Deserialize<'de> for Separation
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 Separation
impl PartialEq for Separation
Source§fn eq(&self, other: &Separation) -> bool
fn eq(&self, other: &Separation) -> bool
self and other values to be equal, and is used by ==.