pub struct StrandedWire(/* private fields */);Expand description
A stranded wire consistings of multiple WireGroups.
A stranded wire is composed of a number of small wires bundled or wrapped together to form a larger conductor. Compared to a single solid wire, this configuration is more mechanically flexible and allows the usage of a few standardized wires to realize various different cross-sections.
To simplify the implementation, each wire within the given WireGroups must
have the same material. In practice, this is not a huge issue, as conductors
of different materials are usually not used together in a stranded wire.
§Example
A stranded wire consisting of three wires of type A and two wires
of type B can be represented as:
WireGroup { wire: A, number_wires: 3 }WireGroup { wire: B, number_wires: 2 }
These groups together form a StrandedWire:
use std::sync::Arc;
use std::num::NonZero;
use stem_wire::prelude::*;
let wire_a = RoundWire::new(
Arc::new(Material::default()),
Length::new::<millimeter>(0.5),
Length::new::<millimeter>(0.0),
Length::new::<millimeter>(0.1)
).unwrap();
let wire_b = RoundWire::new(
Arc::new(Material::default()),
Length::new::<millimeter>(0.4),
Length::new::<millimeter>(0.0),
Length::new::<millimeter>(0.1)
).unwrap();
// Returns OK because the vector of wires was not empty
assert!(StrandedWire::new(vec![
WireGroup::new(Box::new(wire_a), NonZero::new(3).unwrap()),
WireGroup::new(Box::new(wire_b), NonZero::new(2).unwrap()),
]).is_ok());Implementations§
Source§impl StrandedWire
impl StrandedWire
Sourcepub fn new(wire_groups: Vec<WireGroup>) -> Result<Self, Error>
pub fn new(wire_groups: Vec<WireGroup>) -> Result<Self, Error>
Returns a new stranded wire if the given vector of WireGroup fulfills
the following conditions:
- It is not empty.
- All wires must have the same material.
§Examples
use std::sync::Arc;
use std::num::NonZero;
use stem_wire::prelude::*;
let wire_a = RoundWire::new(
Arc::new(Material::default()),
Length::new::<millimeter>(0.5),
Length::new::<millimeter>(0.0),
Length::new::<millimeter>(0.1)
).unwrap();
let wire_b = RoundWire::new(
Arc::new(Material::default()),
Length::new::<millimeter>(0.4),
Length::new::<millimeter>(0.0),
Length::new::<millimeter>(0.1)
).unwrap();
let mut material = Material::default();
material.electrical_resistivity = ElectricalResistivity::new::<ohm_meter>(0.1).into();
let wire_c = RoundWire::new(
Arc::new(material),
Length::new::<millimeter>(0.4),
Length::new::<millimeter>(0.0),
Length::new::<millimeter>(0.1)
).unwrap();
assert!(StrandedWire::new(vec![
WireGroup::new(Box::new(wire_a.clone()), NonZero::new(3).unwrap()),
WireGroup::new(Box::new(wire_b), NonZero::new(2).unwrap()),
]).is_ok());
// Empty list
assert!(StrandedWire::new(Vec::new()).is_err());
// Not all wires have the same material
assert!(StrandedWire::new(vec![
WireGroup::new(Box::new(wire_a), NonZero::new(3).unwrap()),
WireGroup::new(Box::new(wire_c), NonZero::new(2).unwrap()),
]).is_err());Trait Implementations§
Source§impl Clone for StrandedWire
impl Clone for StrandedWire
Source§fn clone(&self) -> StrandedWire
fn clone(&self) -> StrandedWire
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StrandedWire
impl Debug for StrandedWire
Source§impl<'de> Deserialize<'de> for StrandedWire
Available on crate feature serde only.
impl<'de> Deserialize<'de> for StrandedWire
serde only.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 Serialize for StrandedWire
impl Serialize for StrandedWire
Source§impl Wire for StrandedWire
impl Wire for StrandedWire
Source§fn material(&self) -> &Material
fn material(&self) -> &Material
Source§fn effective_conductor_area(&self, zone_area: Area, turns: usize) -> Area
fn effective_conductor_area(&self, zone_area: Area, turns: usize) -> Area
Source§fn effective_overall_area(&self, zone_area: Area, turns: usize) -> Area
fn effective_overall_area(&self, zone_area: Area, turns: usize) -> Area
Source§fn resistance(
&self,
length: Length,
zone_area: Area,
turns: usize,
conditions: &[DynQuantity<f64>],
) -> ElectricalResistance
fn resistance( &self, length: Length, zone_area: Area, turns: usize, conditions: &[DynQuantity<f64>], ) -> ElectricalResistance
length under influence of
the specified conditions. Read moreAuto Trait Implementations§
impl Freeze for StrandedWire
impl !RefUnwindSafe for StrandedWire
impl Send for StrandedWire
impl Sync for StrandedWire
impl Unpin for StrandedWire
impl UnsafeUnpin for StrandedWire
impl !UnwindSafe for StrandedWire
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more