pub struct BatesGrains {
pub count: u32,
pub density_kg_m3: f64,
pub outer_radius_m: f64,
pub initial_inner_radius_m: f64,
pub initial_height_m: f64,
pub separation_m: f64,
pub center_m: f64,
pub inhibited_ends: bool,
}Expand description
A stack of identical BATES grains.
Fields§
§count: u32Number of grains N, at least 1.
density_kg_m3: f64Propellant density ρ, kg/m³.
outer_radius_m: f64Grain outer radius R, m.
initial_inner_radius_m: f64Initial bore radius r₀, m, positive.
initial_height_m: f64Initial grain height (length) h₀, m.
separation_m: f64Gap between adjacent grains s, m.
center_m: f64Center of the grain stack along the motor axis, m from the nozzle exit.
inhibited_ends: boolWhether the grain ends are inhibited, so only the bores burn (RocketPy’s
only_radial_burn).
Implementations§
Source§impl BatesGrains
impl BatesGrains
Sourcepub fn validate(&self) -> Result<(), MotorError>
pub fn validate(&self) -> Result<(), MotorError>
Checks the geometry.
§Errors
MotorError::Domain for a value that is not finite or out of range (including no bore),
and MotorError::Inconsistent for no grains, a bore at least as wide as the grain, or a
propellant mass that isn’t a positive finite number (geometry so small or dense that it
underflows or overflows).
Sourcepub fn initial_mass_kg(&self) -> f64
pub fn initial_mass_kg(&self) -> f64
The total propellant mass before ignition, N ρ π (R² − r₀²) h₀, kg.
Sourcepub fn web_m(&self) -> f64
pub fn web_m(&self) -> f64
The largest web the grains can burn, m: where the bore reaches the outer radius or, with burning ends, the height reaches zero.
Sourcepub fn shape(&self, mass_kg: f64) -> GrainShape
pub fn shape(&self, mass_kg: f64) -> GrainShape
One grain’s shape when mass_kg of propellant is left in the stack. Masses at or above the
initial mass give the initial shape, and masses at or below zero the burned-out shape.
Sourcepub fn mass_element(&self, mass_kg: f64) -> MassElement
pub fn mass_element(&self, mass_kg: f64) -> MassElement
The grains, with mass_kg of propellant left, as one mass element about the stack center.
Trait Implementations§
Source§impl Clone for BatesGrains
impl Clone for BatesGrains
Source§fn clone(&self) -> BatesGrains
fn clone(&self) -> BatesGrains
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 BatesGrains
Source§impl Debug for BatesGrains
impl Debug for BatesGrains
Source§impl<'de> Deserialize<'de> for BatesGrains
impl<'de> Deserialize<'de> for BatesGrains
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 JsonSchema for BatesGrains
impl JsonSchema for BatesGrains
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BatesGrains
impl PartialEq for BatesGrains
Source§fn eq(&self, other: &BatesGrains) -> bool
fn eq(&self, other: &BatesGrains) -> bool
self and other values to be equal, and is used by ==.