pub struct Stream<Fluid> {
pub rate: Constrained<MassRate, StrictlyPositive>,
pub state: State<Fluid>,
}Expand description
A stream of fluid at a thermodynamic state.
A Stream represents steady-state transport of mass and energy without
storing either. For transient systems with mass or energy storage, use a
ControlVolume.
Zero-flow streams are not physically meaningful.
Use Option<Stream<Fluid>> to represent an optional or inactive stream.
Fields§
§rate: Constrained<MassRate, StrictlyPositive>§state: State<Fluid>Implementations§
Source§impl<Fluid> Stream<Fluid>
impl<Fluid> Stream<Fluid>
Sourcepub fn new(rate: MassRate, state: State<Fluid>) -> Result<Self, ConstraintError>
pub fn new(rate: MassRate, state: State<Fluid>) -> Result<Self, ConstraintError>
Creates a new Stream from a mass rate and thermodynamic state.
§Errors
Returns a ConstraintError if rate is not strictly positive.
Sourcepub fn from_constrained(
rate: Constrained<MassRate, StrictlyPositive>,
state: State<Fluid>,
) -> Self
pub fn from_constrained( rate: Constrained<MassRate, StrictlyPositive>, state: State<Fluid>, ) -> Self
Creates a new Stream from a pre-validated positive mass rate and state.
Sourcepub fn enthalpy_flow<Model>(
&self,
model: &Model,
) -> Result<Power, PropertyError>where
Model: ThermoModel<Fluid = Fluid> + HasEnthalpy,
pub fn enthalpy_flow<Model>(
&self,
model: &Model,
) -> Result<Power, PropertyError>where
Model: ThermoModel<Fluid = Fluid> + HasEnthalpy,
Returns the enthalpy flow rate of this stream.
This method computes the energy flow carried by the stream as ṁ · h,
where ṁ is the mass flow rate and h is the enthalpy of its state.
§Errors
Returns a PropertyError if enthalpy cannot be computed.
Trait Implementations§
impl<Fluid: Copy> Copy for Stream<Fluid>
Source§impl<Fluid: PartialEq> PartialEq for Stream<Fluid>
impl<Fluid: PartialEq> PartialEq for Stream<Fluid>
impl<Fluid: PartialEq> StructuralPartialEq for Stream<Fluid>
Auto Trait Implementations§
impl<Fluid> Freeze for Stream<Fluid>where
Fluid: Freeze,
impl<Fluid> RefUnwindSafe for Stream<Fluid>where
Fluid: RefUnwindSafe,
impl<Fluid> Send for Stream<Fluid>where
Fluid: Send,
impl<Fluid> Sync for Stream<Fluid>where
Fluid: Sync,
impl<Fluid> Unpin for Stream<Fluid>where
Fluid: Unpin,
impl<Fluid> UnsafeUnpin for Stream<Fluid>where
Fluid: UnsafeUnpin,
impl<Fluid> UnwindSafe for Stream<Fluid>where
Fluid: UnwindSafe,
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
Mutably borrows from an owned value. Read more