Update project structure and configurations
This commit is contained in:
@@ -57,12 +57,15 @@
|
||||
|
||||
pub mod air_boundary;
|
||||
pub mod brine_boundary;
|
||||
pub mod bypass_valve;
|
||||
pub mod compressor;
|
||||
pub mod curves;
|
||||
pub mod drum;
|
||||
pub mod expansion_valve;
|
||||
pub mod external_model;
|
||||
pub mod fan;
|
||||
pub mod flow_junction;
|
||||
pub mod free_cooling_exchanger;
|
||||
pub mod heat_exchanger;
|
||||
pub mod node;
|
||||
pub mod params;
|
||||
@@ -70,6 +73,7 @@ pub mod pipe;
|
||||
pub mod polynomials;
|
||||
pub mod port;
|
||||
pub mod pump;
|
||||
pub mod registry;
|
||||
pub mod python_components;
|
||||
pub mod refrigerant_boundary;
|
||||
pub mod screw_economizer_compressor;
|
||||
@@ -77,7 +81,11 @@ pub mod state_machine;
|
||||
|
||||
pub use air_boundary::{AirSink, AirSource};
|
||||
pub use brine_boundary::{BrineSink, BrineSource};
|
||||
pub use bypass_valve::{BypassValve, BypassValveConfig, ValveCharacteristics};
|
||||
pub use compressor::{Ahri540Coefficients, Compressor, CompressorModel, SstSdtCoefficients};
|
||||
pub use curves::{
|
||||
BoundedCurve, CurveEngine, CurveEval, CurveResult, CurveSet, CurveWarning,
|
||||
};
|
||||
pub use drum::Drum;
|
||||
pub use expansion_valve::{ExpansionValve, PhaseRegion};
|
||||
pub use external_model::{
|
||||
@@ -85,6 +93,9 @@ pub use external_model::{
|
||||
ExternalModelType, MockExternalModel, ThreadSafeExternalModel,
|
||||
};
|
||||
pub use fan::{Fan, FanCurves};
|
||||
pub use free_cooling_exchanger::{
|
||||
FreeCoolingConfig, FreeCoolingControlMode, FreeCoolingExchanger, FreeCoolingMode,
|
||||
};
|
||||
pub use flow_junction::{
|
||||
CompressibleMerger, CompressibleSplitter, FlowMerger, FlowSplitter, FluidKind,
|
||||
IncompressibleMerger, IncompressibleSplitter,
|
||||
@@ -97,6 +108,7 @@ pub use heat_exchanger::{
|
||||
};
|
||||
pub use node::{Node, NodeMeasurements, NodePhase};
|
||||
pub use params::ComponentParams;
|
||||
pub use registry::{RegistryError, create_component};
|
||||
pub use pipe::{friction_factor, roughness, Pipe, PipeGeometry};
|
||||
pub use polynomials::{AffinityLaws, PerformanceCurves, Polynomial1D, Polynomial2D};
|
||||
pub use port::{
|
||||
@@ -107,6 +119,8 @@ pub use pump::{Pump, PumpCurves};
|
||||
pub use python_components::{
|
||||
PyCompressorReal, PyExpansionValveReal, PyFlowMergerReal, PyFlowSinkReal, PyFlowSourceReal,
|
||||
PyFlowSplitterReal, PyHeatExchangerReal, PyPipeReal,
|
||||
PyRefrigerantSourceReal, PyRefrigerantSinkReal, PyBrineSourceReal, PyBrineSinkReal,
|
||||
PyAirSourceReal, PyAirSinkReal,
|
||||
};
|
||||
pub use refrigerant_boundary::{RefrigerantSink, RefrigerantSource};
|
||||
pub use screw_economizer_compressor::{ScrewEconomizerCompressor, ScrewPerformanceCurves};
|
||||
@@ -681,6 +695,28 @@ pub trait Component {
|
||||
// Default: no-op for components that don't support inverse calibration
|
||||
}
|
||||
|
||||
/// Updates a single calibration factor on this component.
|
||||
///
|
||||
/// Returns `true` if the factor was recognized and updated. The default
|
||||
/// implementation returns `false` (component does not support calibration).
|
||||
/// Components that override this should also apply side effects (e.g.
|
||||
/// updating internal model parameters).
|
||||
fn update_calib_factor(&mut self, _factor: &str, _value: f64) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Injects a fluid backend into this component for thermodynamic property queries.
|
||||
///
|
||||
/// Called by [`SystemBuilder::build()`] when a default or per-circuit backend is configured.
|
||||
/// Components that already have a backend (set via their own builder) should ignore the call
|
||||
/// to preserve the pre-assigned backend.
|
||||
///
|
||||
/// The default implementation is a no-op — components that don't use fluid backends
|
||||
/// silently ignore this.
|
||||
fn set_fluid_backend_from_builder(&mut self, _backend: std::sync::Arc<dyn entropyk_fluids::FluidBackend>) {
|
||||
// Default: no-op for components that don't use fluid backends
|
||||
}
|
||||
|
||||
/// Evaluates the energy interactions of the component with its environment.
|
||||
///
|
||||
/// Returns a tuple of `(HeatTransfer, WorkTransfer)` in Watts (converted to `Power`).
|
||||
@@ -713,11 +749,14 @@ pub trait Component {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use entropyk_components::{Component, ComponentParams};
|
||||
/// use entropyk_components::{Component, ComponentParams, ComponentError, StateSlice, ResidualVector, JacobianBuilder, ConnectedPort};
|
||||
///
|
||||
/// struct MyComponent;
|
||||
/// impl Component for MyComponent {
|
||||
/// // ... other required methods ...
|
||||
/// fn compute_residuals(&self, _s: &StateSlice, _r: &mut ResidualVector) -> Result<(), ComponentError> { Ok(()) }
|
||||
/// fn jacobian_entries(&self, _s: &StateSlice, _j: &mut JacobianBuilder) -> Result<(), ComponentError> { Ok(()) }
|
||||
/// fn n_equations(&self) -> usize { 2 }
|
||||
/// fn get_ports(&self) -> &[ConnectedPort] { &[] }
|
||||
///
|
||||
/// fn to_params(&self) -> ComponentParams {
|
||||
/// ComponentParams::new("MyComponent")
|
||||
|
||||
Reference in New Issue
Block a user