pub enum WorkFlow {
In(Constrained<Power, StrictlyPositive>),
Out(Constrained<Power, StrictlyPositive>),
None,
}Expand description
Represents work flow across a system boundary.
This enum represents flow direction relative to the system:
In: Work flows into the system (positive contribution, work done on the system).Out: Work flows out of the system (negative contribution, work done by the system).None: No work flow occurs.
Note: Some thermodynamic texts define work as positive when done by
the system (i.e., flowing out).
This crate uses the opposite convention: positive = into the system,
for consistency with HeatFlow and
MassFlow sign conventions.
Variants§
In(Constrained<Power, StrictlyPositive>)
Work flowing into the system.
Out(Constrained<Power, StrictlyPositive>)
Work flowing out of the system.
None
No work flow occurs.
Implementations§
Source§impl WorkFlow
impl WorkFlow
Sourcepub fn incoming(work_rate: Power) -> Result<Self, ConstraintError>
pub fn incoming(work_rate: Power) -> Result<Self, ConstraintError>
Creates a WorkFlow::In representing work flowing into the system.
§Errors
Returns a ConstraintError if work_rate is not strictly positive.
Sourcepub fn outgoing(work_rate: Power) -> Result<Self, ConstraintError>
pub fn outgoing(work_rate: Power) -> Result<Self, ConstraintError>
Creates a WorkFlow::Out representing work flowing out of the system.
§Errors
Returns a ConstraintError if work_rate is not strictly positive.
Sourcepub fn from_signed(work_rate: Power) -> Result<Self, ConstraintError>
pub fn from_signed(work_rate: Power) -> Result<Self, ConstraintError>
Creates a WorkFlow from a signed work flow rate.
- Positive values indicate work flowing into the system.
- Negative values indicate work flowing out of the system.
- Zero indicates no work flow.
§Errors
Returns a ConstraintError::NotANumber if the value is not finite.