chore: update documentation to reflect recent architectural changes and improve clarity
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
|
||||
use approx::assert_relative_eq;
|
||||
use entropyk_components::{
|
||||
Ahri540Coefficients, Compressor, CompressorModel, ConnectedPort, EpsNtuModel, ExchangerType,
|
||||
ExpansionValve, FluidId, OperationalState, Port, Pump, SstSdtCoefficients,
|
||||
StateManageable,
|
||||
Ahri540Coefficients, BrineSink, BrineSource, ConnectedPort, EpsNtuModel, ExpansionValve,
|
||||
FluidId, OperationalState, Port, SstSdtCoefficients,
|
||||
};
|
||||
use entropyk_components::heat_exchanger::HeatTransferModel;
|
||||
use entropyk_core::{Enthalpy, MassFlow, Pressure, Temperature};
|
||||
use entropyk_core::{Concentration, Enthalpy, MassFlow, Pressure, Temperature};
|
||||
use std::sync::Arc;
|
||||
|
||||
// =============================================================================
|
||||
// Story 1-2: Physical Types (NewType Pattern)
|
||||
@@ -245,7 +245,7 @@ mod story_1_7_state_machine {
|
||||
fn test_operational_state_transitions() {
|
||||
let on = OperationalState::On;
|
||||
let off = OperationalState::Off;
|
||||
let bypass = OperationalState::Bypass;
|
||||
let _bypass = OperationalState::Bypass;
|
||||
|
||||
// On can transition to any state
|
||||
assert!(on.can_transition_to(OperationalState::Off));
|
||||
@@ -336,34 +336,41 @@ mod story_1_11_junctions {
|
||||
|
||||
#[test]
|
||||
fn test_flow_source_creation() {
|
||||
// FlowSource::new() is removed; use ::incompressible() (deprecated but still functional)
|
||||
#[allow(deprecated)]
|
||||
{
|
||||
use entropyk_components::FlowSource;
|
||||
let port = make_connected_port("Water", 100_000.0, 42_000.0);
|
||||
let source = FlowSource::incompressible(
|
||||
"Water",
|
||||
100_000.0,
|
||||
42_000.0,
|
||||
port,
|
||||
);
|
||||
assert!(source.is_ok());
|
||||
let s = source.unwrap();
|
||||
assert_eq!(s.fluid_id(), "Water");
|
||||
}
|
||||
// Boundary source for incompressible fluid: use BrineSource (replaces legacy FlowSource)
|
||||
use entropyk_fluids::IncompressibleBackend;
|
||||
|
||||
let port = make_connected_port("Water", 100_000.0, 42_000.0);
|
||||
let backend = Arc::new(IncompressibleBackend::new());
|
||||
let source = BrineSource::new(
|
||||
"Water",
|
||||
Pressure::from_pascals(100_000.0),
|
||||
Temperature::from_celsius(10.0),
|
||||
Concentration::from_percent(0.0),
|
||||
backend,
|
||||
port,
|
||||
);
|
||||
assert!(source.is_ok());
|
||||
let s = source.unwrap();
|
||||
assert_eq!(s.fluid_id(), "Water");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_flow_sink_creation() {
|
||||
// FlowSink::new() is removed; use ::incompressible() (deprecated but still functional)
|
||||
#[allow(deprecated)]
|
||||
{
|
||||
use entropyk_components::FlowSink;
|
||||
let port = make_connected_port("Water", 100_000.0, 42_000.0);
|
||||
let sink = FlowSink::incompressible("Water", 100_000.0, None, port);
|
||||
assert!(sink.is_ok());
|
||||
let s = sink.unwrap();
|
||||
assert_eq!(s.fluid_id(), "Water");
|
||||
}
|
||||
// Boundary sink for incompressible fluid: use BrineSink (replaces legacy FlowSink)
|
||||
use entropyk_fluids::IncompressibleBackend;
|
||||
|
||||
let port = make_connected_port("Water", 100_000.0, 42_000.0);
|
||||
let backend = Arc::new(IncompressibleBackend::new());
|
||||
let sink = BrineSink::new(
|
||||
"Water",
|
||||
Pressure::from_pascals(100_000.0),
|
||||
None,
|
||||
None,
|
||||
backend,
|
||||
port,
|
||||
);
|
||||
assert!(sink.is_ok());
|
||||
let s = sink.unwrap();
|
||||
assert_eq!(s.fluid_id(), "Water");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user