Schema and Configuration
The OpenPinch.lib package defines the typed contract between external
callers and the analysis engine. If you are building an application around
OpenPinch, this is the package that tells you what inputs are accepted, what
outputs are returned, and which enumerated labels and configuration flags are
expected throughout the workflow.
Configuration and Numeric Conventions
OpenPinch.lib.config provides the runtime configuration object and the
global constants used across multiple modules. Many option names intentionally
mirror the long-standing Excel workbook so workbook and Python workflows can
share the same mental model.
Typed configuration primitives and schemas for OpenPinch.
The OpenPinch.lib package exposes enumerations, configuration helpers,
and the Pydantic schema models that define the wire format used by the public
API. They are re-exported here for consumers that need to construct or inspect
inputs programmatically.
Configuration defaults and global numerical constants for OpenPinch.
- class OpenPinch.lib.config.Configuration(options=None, top_zone_name='Site', top_zone_identifier='Site')[source]
Bases:
objectRuntime configuration translated from flat user-facing option keys.
Initialise defaults and optionally apply validated flat options.
- classmethod from_options(options=None, *, top_zone_name='Site', top_zone_identifier='Site')[source]
Build a runtime configuration from flat user-facing options.
- Parameters:
- Return type:
- classmethod options_catalog()[source]
Return declarative metadata for all supported flat option keys.
- for_period(period_id=None, period_idx=None)[source]
Return a lightweight period context for this configuration.
Enumerations and Labels
The enums module centralises the canonical names used for zones, targets,
streams, graph series, heat exchanger network design methods, and
workbook-compatible option keys. Refer to these when you need stable
identifiers instead of free-form strings. Heat exchanger network synthesis uses
HeatExchangerNetworkDesignMethod for both public dispatch and task/result
method metadata, with HENDesignMethod as the shorter alias.
Enumerations and lightweight typed contracts used across OpenPinch.
These enums standardize zone types, stream classifications, Problem Table column names, graph labels, and options keys used by configuration and schemas.
- class OpenPinch.lib.enums.BB_Minimiser(*values)[source]
-
Supported optimisation backends for multistart black-box search.
- class OpenPinch.lib.enums.CogenerationTarget(*args, **kwargs)[source]
Bases:
ProtocolCompatible target surface required by cogeneration analysis helpers.
- class OpenPinch.lib.enums.FluidPhase(*values)[source]
-
Supported stream fluid-phase flags.
- class OpenPinch.lib.enums.GraphType(*values)[source]
Bases:
EnumGraph groups available in OpenPinch reporting data.
- class OpenPinch.lib.enums.HeatExchangerKind(*values)[source]
-
Supported heat-transfer link families in a heat exchanger network design.
- OpenPinch.lib.enums.HEN
alias of
HeatExchangerNetworkLabel
- class OpenPinch.lib.enums.HeatExchangerNetworkLabel(*values)[source]
Bases:
EnumHeat exchanger network metric labels for labelled accessors.
- class OpenPinch.lib.enums.HeatExchangerStreamRole(*values)[source]
-
Identity class for the source and sink streams on an exchanger link.
- class OpenPinch.lib.enums.HeatExchangerTypes(*values)[source]
Bases:
EnumHeat exchanger flow arrangements
- class OpenPinch.lib.enums.HeatPumpAndRefrigerationCycle(*values)[source]
-
Supported heat pump targeting model families.
- OpenPinch.lib.enums.HPRcycle
alias of
HeatPumpAndRefrigerationCycle
- class OpenPinch.lib.enums.LegendSeries(*values)[source]
Bases:
EnumLegend labels for multi-series graphs.
- class OpenPinch.lib.enums.ProblemTableLabel(*values)[source]
Bases:
EnumProblem table column header labels
- OpenPinch.lib.enums.PT
alias of
ProblemTableLabel
- OpenPinch.lib.enums.SD
alias of
StreamDataLabel
- OpenPinch.lib.enums.ST
alias of
StreamType
- class OpenPinch.lib.enums.StreamDataLabel(*values)[source]
Bases:
EnumStream data column header labels
- class OpenPinch.lib.enums.SummaryRowType(*values)[source]
Bases:
EnumRow semantics for tabular summary output.
- class OpenPinch.lib.enums.TargetType(*values)[source]
Bases:
EnumDifferent target calculation categories.
- OpenPinch.lib.enums.TT
alias of
TargetType
- class OpenPinch.lib.enums.TurbineModel(*values)[source]
Bases:
EnumAlternative turbine performance correlations used in power targeting.
Pydantic Schemas
The schema layer is the primary programmatic interface to OpenPinch. It is now
split by concern under OpenPinch.lib.schemas rather than concentrated in
one large module.
The main schema modules are:
OpenPinch.lib.schemas.commonfor shared primitives such asValueWithUnitOpenPinch.lib.schemas.graphsfor graph data contractsOpenPinch.lib.schemas.iofor public request and response modelsOpenPinch.lib.schemas.reportingfor summary and report-facing modelsOpenPinch.lib.schemas.hprfor lower-level heat pump solver data modelsOpenPinch.lib.schemas.synthesisfor heat exchanger network synthesis method input/output, task, manifest, optional export, and design-result result dataOpenPinch.lib.schemas.targetsfor runtime target models stored on solved zonesOpenPinch.lib.schemas.turbinefor turbine solve result models
Common request models include:
Common response and reporting models include:
Heat pump integration helper models include:
Specialised helper models also capture lower-level Heat Pump optimisation inputs/outputs, integrated Heat Pump screening comparisons, piecewise stream linearisation requests, and structured targeting/graph outputs.
Concern-based schema package for OpenPinch.
Common schema primitives and shared type aliases.
- class OpenPinch.lib.schemas.common.PeriodValueWithUnit(*, values, unit=None)[source]
Bases:
BaseModelContainer storing multi-period magnitudes, weights, and a shared unit.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.common.PeriodValueWithUnitAndWeights(*, values, unit=None, weights=None)[source]
Bases:
BaseModelContainer storing multi-period magnitudes, weights, and a shared unit.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.common.ValueWithUnit(*, value=None, unit=None)[source]
Bases:
BaseModelContainer storing a magnitude and its associated unit string.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Graph data schemas.
- class OpenPinch.lib.schemas.graphs.DataPoint(*, x, y)[source]
Bases:
BaseModelCoordinate used to construct composite curves and other plots.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.graphs.Graph(*, type, segments=<factory>)[source]
Bases:
BaseModelCollection of segments representing a single graph (e.g., GCC).
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'use_enum_values': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.graphs.GraphSet(*, name='GraphSet', target_type=None, period_id=None, zone_name=None, zone_address=None, graphs=<factory>)[source]
Bases:
BaseModelNamed group of graphs emitted for a particular zone or context.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.graphs.Segment(*, title=None, colour=None, arrow=None, data_points=<factory>)[source]
Bases:
BaseModelContinuous plot segment optionally annotated with colour/arrows.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Schemas used by heat pump and refrigeration solvers.
- class OpenPinch.lib.schemas.hpr.HPRPeriodCase(*, period_id, period_idx, weight, args)[source]
Bases:
BaseModelPrepared single-period case evaluated by a shared HPR design vector.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
period_id (str)
period_idx (int)
weight (float)
args (HeatPumpTargetInputs)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.HeatPumpTargetInputs(*, hpr_type, Q_hpr_target, Q_heat_max, Q_cool_max, z_amb_hot, z_amb_cold, dt_range_max, T_hot, H_hot, T_cold, H_cold, n_cond, n_evap, n_mvr, eta_comp, eta_mvr_comp, eta_motor, eta_exp, dtcont_hp, dt_hp_ihx, dt_cascade_hx, dt_phase_change, heat_to_power_ratio, cold_to_power_ratio, ele_price, annual_op_time, discount_rate, serv_life, hpr_comp_fixed_cost, hpr_comp_variable_cost, hpr_comp_cost_exp, hpr_hx_fixed_cost, hpr_hx_variable_cost, hpr_hx_cost_exp, is_heat_pumping, max_multi_start, T_env, dt_env_cont, eta_ii_hpr_carnot, eta_ii_he_carnot, refrigerant_ls, mvr_fluid_ls, do_refrigerant_sort, initialise_simulated_cycle, allow_integrated_expander, bckgrd_hot_streams, bckgrd_cold_streams, bb_minimiser, eta_penalty, rho_penalty, period_idx=0, debug)[source]
Bases:
BaseModelParameter bundle for heat pump and refrigeration targeting routines.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
hpr_type (str)
Q_hpr_target (float)
Q_heat_max (float)
Q_cool_max (float)
z_amb_hot (ndarray)
z_amb_cold (ndarray)
dt_range_max (float)
T_hot (ndarray)
H_hot (ndarray)
T_cold (ndarray)
H_cold (ndarray)
n_cond (int)
n_evap (int)
n_mvr (int)
eta_comp (float)
eta_mvr_comp (float)
eta_motor (float)
eta_exp (float)
dtcont_hp (float)
dt_hp_ihx (float)
dt_cascade_hx (float)
dt_phase_change (float)
heat_to_power_ratio (float)
cold_to_power_ratio (float)
ele_price (float)
annual_op_time (float)
discount_rate (float)
serv_life (float)
hpr_comp_fixed_cost (float)
hpr_comp_variable_cost (float)
hpr_comp_cost_exp (float)
hpr_hx_fixed_cost (float)
hpr_hx_variable_cost (float)
hpr_hx_cost_exp (float)
is_heat_pumping (bool)
max_multi_start (int)
T_env (float)
dt_env_cont (float)
eta_ii_hpr_carnot (float)
eta_ii_he_carnot (float)
do_refrigerant_sort (bool)
initialise_simulated_cycle (bool)
allow_integrated_expander (bool)
bckgrd_hot_streams (StreamCollection)
bckgrd_cold_streams (StreamCollection)
bb_minimiser (str)
eta_penalty (float)
rho_penalty (float)
period_idx (int)
debug (bool)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.HeatPumpTargetOutputs(*, utility_tot, w_net, w_hpr=None, w_he=None, heat_recovery=None, Q_ext, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, Q_amb_hot, Q_amb_cold, cop_h=None, eta_he=None, obj, success, hpr_hot_streams, hpr_cold_streams, amb_streams, T_cond=None, T_evap=None, Q_cond=None, Q_evap=None, Q_cond_he=None, Q_evap_he=None, dT_subcool=None, dT_superheat=None, T_comp_out=None, dT_gc=None, dT_comp=None, Q_heat=None, Q_cool=None, model=None, period_outputs=None, weighted_output=None, design_vector=None, period_ids=None, period_weights=None)[source]
Bases:
BaseModelNormalized output contract for HPR targeting routines.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
utility_tot (float)
Q_ext (float)
hpr_operating_cost (Any | None)
hpr_capital_cost (Any | None)
hpr_annualized_capital_cost (Any | None)
hpr_total_annualized_cost (Any | None)
hpr_compressor_capital_cost (Any | None)
hpr_heat_exchanger_capital_cost (Any | None)
Q_amb_hot (float)
Q_amb_cold (float)
obj (float)
success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
amb_streams (StreamCollection)
T_cond (ndarray | None)
T_evap (ndarray | None)
Q_cond (ndarray | None)
Q_evap (ndarray | None)
Q_cond_he (ndarray | None)
Q_evap_he (ndarray | None)
dT_subcool (ndarray | None)
dT_superheat (ndarray | None)
T_comp_out (ndarray | None)
dT_gc (ndarray | None)
dT_comp (ndarray | None)
Q_heat (ndarray | None)
Q_cool (ndarray | None)
model (Any | None)
weighted_output (Any | None)
design_vector (ndarray | None)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.MultiPeriodHPRTargetInputs(*, period_cases, selected_period_id, selected_period_idx, hpr_type, max_multi_start, bb_minimiser, debug=False)[source]
Bases:
BaseModelPrepared all-period HPR optimisation inputs.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.SimulatedHPRAnnualizedCostAccounting(*, hpr_operating_cost, hpr_capital_cost, hpr_annualized_capital_cost, hpr_total_annualized_cost, hpr_compressor_capital_cost, hpr_heat_exchanger_capital_cost, feasibility_penalty)[source]
Bases:
BaseModelUnit-aware annualized cost accounting for simulated HPR candidates.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.HPRParsedState(*, Q_amb_hot=0.0, Q_amb_cold=0.0, Q_amb_hot_direct=0.0, Q_amb_cold_direct=0.0, Q_amb_hot_residual=0.0, Q_amb_cold_residual=0.0, T_cond=None, T_evap=None, dT_subcool=None, dT_superheat=None, dT_ihx_gas_side=None, T_comp_out=None, dT_gc=None, dT_comp=None, Q_heat=None, Q_cool=None, Q_heat_base=None, Q_cool_base=None, x_heat_split=None, x_cool_split=None, Q_heat_available=None, Q_cool_available=None, x_mvr_source_split=None, x_mvr_process_split=None)[source]
Bases:
BaseModelInternal parsed optimisation-state data across HPR backends.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
Q_amb_hot (float)
Q_amb_cold (float)
Q_amb_hot_direct (float)
Q_amb_cold_direct (float)
Q_amb_hot_residual (float)
Q_amb_cold_residual (float)
T_cond (ndarray | None)
T_evap (ndarray | None)
dT_subcool (ndarray | None)
dT_superheat (ndarray | None)
dT_ihx_gas_side (ndarray | None)
T_comp_out (ndarray | None)
dT_gc (ndarray | None)
dT_comp (ndarray | None)
Q_heat (ndarray | None)
Q_cool (ndarray | None)
Q_heat_base (float | None)
Q_cool_base (float | None)
x_heat_split (ndarray | None)
x_cool_split (ndarray | None)
Q_heat_available (ndarray | None)
Q_cool_available (ndarray | None)
x_mvr_source_split (float | None)
x_mvr_process_split (ndarray | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.HPRThermoArtifacts(*, hpr_streams=None, model=None, debug_figure=None)[source]
Bases:
BaseModelOptional solved thermodynamic artefacts attached to a backend result.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
hpr_streams (StreamCollection | None)
model (Any)
debug_figure (Any)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.hpr.HPRBackendResult(*, obj, utility_tot, w_net, Q_ext_heat, Q_ext_cold, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, feasibility_penalty=0.0, Q_amb_hot, Q_amb_cold, success=True, w_hpr=None, w_he=None, heat_recovery=None, cop_h=None, eta_he=None, amb_streams=None, T_cond=None, T_evap=None, Q_cond=None, Q_evap=None, Q_cond_he=None, Q_evap_he=None, dT_subcool=None, dT_superheat=None, T_comp_out=None, dT_gc=None, dT_comp=None, Q_heat=None, Q_cool=None, failure_reason=None, artifacts=None, period_outputs=None, weighted_output=None, design_vector=None, period_ids=None, period_weights=None)[source]
Bases:
BaseModelInternal backend result before public schema validation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
obj (float)
utility_tot (float)
Q_ext_heat (float)
Q_ext_cold (float)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
feasibility_penalty (float)
Q_amb_hot (float)
Q_amb_cold (float)
success (bool)
amb_streams (StreamCollection | None)
T_cond (ndarray | None)
T_evap (ndarray | None)
Q_cond (ndarray | None)
Q_evap (ndarray | None)
Q_cond_he (ndarray | None)
Q_evap_he (ndarray | None)
dT_subcool (ndarray | None)
dT_superheat (ndarray | None)
T_comp_out (ndarray | None)
dT_gc (ndarray | None)
dT_comp (ndarray | None)
Q_heat (ndarray | None)
Q_cool (ndarray | None)
failure_reason (str | None)
artifacts (HPRThermoArtifacts | None)
weighted_output (Any)
design_vector (ndarray | None)
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Schemas for external inputs, outputs, and user-facing I/O data.
- class OpenPinch.lib.schemas.io.NonLinearStream(*, t_supply, t_target, p_supply, p_target, h_supply, h_target, composition)[source]
Bases:
BaseModelNonlinear stream definition used by piecewise linearisation utilities.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.StreamSchema(*, zone, name, segments=None, profile=None, t_supply=None, t_target=None, p_supply=None, p_target=None, h_supply=None, h_target=None, heat_flow=None, heat_capacity_flowrate=None, dt_cont=0.0, htc=1.0, fluid_name=None, fluid_phase=None, active=True)[source]
Bases:
BaseModelProcess stream definition supplied to the targeting service.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone (str)
name (str)
segments (List[StreamSegmentSchema] | None)
profile (TemperatureHeatProfileSchema | None)
t_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
t_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
p_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
p_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
heat_flow (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
heat_capacity_flowrate (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
dt_cont (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
htc (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
fluid_name (str | None)
fluid_phase (FluidPhase | None)
active (bool)
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.StreamSegmentSchema(*, name=None, t_supply, t_target, heat_flow, p_supply=None, p_target=None, h_supply=None, h_target=None, dt_cont=None, htc=None, price=None)[source]
Bases:
BaseModelOne ordered linear interval in a variable-CP stream profile.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str | None)
t_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights)
t_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights)
heat_flow (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights)
p_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
p_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
dt_cont (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
htc (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
price (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.TargetInput(*, streams, utilities=<factory>, options=None, zone_tree=None)[source]
Bases:
BaseModelValidated top-level input data for
pinch_analysis_service.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
streams (List[StreamSchema])
utilities (List[UtilitySchema])
options (dict | None)
zone_tree (ZoneTreeSchema | None)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.TargetOutput(*, name='Site', period_id=None, targets, graphs=None, design=None)[source]
Bases:
BaseModelTop-level response data returned by
OpenPinch.pinch_analysis_service().Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.TemperatureHeatPointSchema(*, cumulative_heat, temperature)[source]
Bases:
BaseModelOne temperature and cumulative-heat coordinate in an ordered profile.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
cumulative_heat (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights)
temperature (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights)
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.TemperatureHeatProfileSchema(*, points, linearisation_tolerance=0.1)[source]
Bases:
BaseModelOrdered temperature-cumulative-heat data for one physical stream.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
points (List[TemperatureHeatPointSchema])
linearisation_tolerance (float)
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.UtilitySchema(*, name, type, segments=None, profile=None, t_supply=None, t_target=None, p_supply=None, p_target=None, h_supply=None, h_target=None, heat_flow=None, dt_cont=0.0, htc=1.0, price=1.0, fluid_name=None, fluid_phase=None, active=True)[source]
Bases:
BaseModelUtility definition including thermal and optional economic attributes.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str)
type (StreamType)
segments (List[StreamSegmentSchema] | None)
profile (TemperatureHeatProfileSchema | None)
t_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
t_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
p_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
p_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_supply (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
h_target (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
heat_flow (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
dt_cont (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
htc (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
price (float | ValueWithUnit | PeriodValueWithUnit | PeriodValueWithUnitAndWeights | None)
fluid_name (str | None)
fluid_phase (FluidPhase | None)
active (bool)
- model_config = {'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.io.ZoneTreeSchema(*, name, type, dt_cont_multiplier=None, children=None)[source]
Bases:
BaseModelRecursive description of the zone hierarchy for the analysis.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str)
type (str)
dt_cont_multiplier (float | None)
children (List[ZoneTreeSchema] | None)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Schemas for serialized summaries and report-facing data.
- class OpenPinch.lib.schemas.reporting.GraphAvailability(*, graph_id, graph_set_id, target_name, zone_name=None, zone_address=None, target_type=None, graph_type=None, graph_name, index)[source]
Bases:
BaseModelOne graph available from a solved report data.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.reporting.HeatUtility(*, name, heat_flow)[source]
Bases:
BaseModelReport-friendly representation of a utility contribution.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'json_encoders': {<class 'OpenPinch.classes.value.Value'>: <function <lambda>>}}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.reporting.ProblemReport(*, project_name, solved, validation, targets=<factory>, metrics=<factory>, graph_catalog=<factory>, warnings=<factory>)[source]
Bases:
BaseModelTyped report data for script, notebook, and export workflows.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
project_name (str)
solved (bool)
validation (ValidationReport)
targets (List[TargetResults])
metrics (List[ReportMetric])
graph_catalog (List[GraphAvailability])
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.reporting.ReportMetric(*, target_name, metric, label, value=None, unit=None, period_id=None)[source]
Bases:
BaseModelOne numeric report metric resolved for a target and optional state.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.reporting.TargetResults(*, name, period_idx=None, period_id=None, degree_of_integration=None, Qh, Qc, Qr, utility_cost=None, row_type=None, hot_utilities=<factory>, cold_utilities=<factory>, pinch_temp, work_target=None, process_component_work_target=None, turbine_efficiency_target=None, area=None, num_units=None, capital_cost=None, total_cost=None, exergy_sources=None, exergy_sinks=None, ETE=None, exergy_req_min=None, exergy_des_min=None, hpr_cycle=None, hpr_utility_total=None, hpr_work=None, hpr_external_utility=None, hpr_ambient_hot=None, hpr_ambient_cold=None, hpr_cop=None, hpr_eta_he=None, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success=None, hpr_hot_streams=None, hpr_cold_streams=None)[source]
Bases:
BaseModelSummary metrics for a single zone/target returned by the analysis.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str)
period_idx (int | None)
period_id (str | None)
degree_of_integration (Value | None)
Qh (Value)
Qc (Value)
Qr (Value)
utility_cost (Value | None)
row_type (str | None)
hot_utilities (List[HeatUtility])
cold_utilities (List[HeatUtility])
pinch_temp (PinchTemp)
work_target (Value | None)
process_component_work_target (Value | None)
turbine_efficiency_target (Value | None)
area (Value | None)
num_units (float | None)
capital_cost (Value | None)
total_cost (Value | None)
exergy_sources (Value | None)
exergy_sinks (Value | None)
ETE (Value | None)
exergy_req_min (Value | None)
exergy_des_min (Value | None)
hpr_cycle (str | None)
hpr_utility_total (Value | None)
hpr_work (Value | None)
hpr_external_utility (Value | None)
hpr_ambient_hot (Value | None)
hpr_ambient_cold (Value | None)
hpr_cop (Value | None)
hpr_eta_he (Value | None)
hpr_operating_cost (Value | None)
hpr_capital_cost (Value | None)
hpr_annualized_capital_cost (Value | None)
hpr_total_annualized_cost (Value | None)
hpr_compressor_capital_cost (Value | None)
hpr_heat_exchanger_capital_cost (Value | None)
hpr_success (bool | None)
hpr_hot_streams (StreamCollection | None)
hpr_cold_streams (StreamCollection | None)
- model_config = {'arbitrary_types_allowed': True, 'json_encoders': {<class 'OpenPinch.classes.value.Value'>: <function <lambda>>}}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.reporting.PinchTemp(*, cold_temp=None, hot_temp=None)[source]
Bases:
BaseModelHot and cold pinch temperatures attached to a targeting record.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config = {'arbitrary_types_allowed': True, 'json_encoders': {<class 'OpenPinch.classes.value.Value'>: <function <lambda>>}}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Concrete heat exchanger network synthesis schema modules.
Runtime target schemas used by OpenPinch analysis services.
- class OpenPinch.lib.schemas.targets.BaseTargetModel(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True)[source]
Bases:
BaseModelShared metadata for all solved target objects.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.DirectHeatPumpTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target=0.0, cold_utility_target=0.0, heat_recovery_target=0.0, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None, hpr_cycle, hpr_utility_total, hpr_work, hpr_external_utility, hpr_ambient_hot, hpr_ambient_cold, hpr_cop, hpr_eta_he, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success, hpr_hot_streams, hpr_cold_streams, hpr_details)[source]
Bases:
HeatPumpTargetBaseDirect heat pump targeting result.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
hpr_cycle (str)
hpr_utility_total (Any)
hpr_work (Any)
hpr_external_utility (Any)
hpr_ambient_hot (Any)
hpr_ambient_cold (Any)
hpr_cop (Any)
hpr_eta_he (Any)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
hpr_success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
hpr_details (Any)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.DirectIntegrationTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target, cold_utility_target, heat_recovery_target, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, pt_real, utility_heat_recovery_target=None, area=None, num_units=None, capital_cost=None, total_cost=None, work_target=None, turbine_efficiency_target=None)[source]
Bases:
GraphBackedTarget,UtilitySummaryTargetDetailed direct-integration runtime target.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
pt_real (ProblemTable)
utility_heat_recovery_target (float | None)
area (float | None)
num_units (float | None)
capital_cost (float | None)
total_cost (float | None)
work_target (float | None)
turbine_efficiency_target (float | None)
- to_target_results(isTotal=False)[source]
Return the reporting data including DI-only cost and work fields.
- Parameters:
isTotal (bool)
- Return type:
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.DirectRefrigerationTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target=0.0, cold_utility_target=0.0, heat_recovery_target=0.0, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None, hpr_cycle, hpr_utility_total, hpr_work, hpr_external_utility, hpr_ambient_hot, hpr_ambient_cold, hpr_cop, hpr_eta_he, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success, hpr_hot_streams, hpr_cold_streams, hpr_details)[source]
Bases:
HeatPumpTargetBaseDirect refrigeration targeting result.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
hpr_cycle (str)
hpr_utility_total (Any)
hpr_work (Any)
hpr_external_utility (Any)
hpr_ambient_hot (Any)
hpr_ambient_cold (Any)
hpr_cop (Any)
hpr_eta_he (Any)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
hpr_success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
hpr_details (Any)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.EnergyTransferTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target, cold_utility_target, heat_recovery_target, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, base_target_type, base_target_name, heat_surplus_deficit_table=<factory>, energy_transfer_diagram=<factory>)[source]
Bases:
GraphBackedTarget,UtilitySummaryTargetEnergy transfer diagram and heat-surplus/deficit table target.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
base_target_type (str)
base_target_name (str)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.HeatPumpTargetBase(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target=0.0, cold_utility_target=0.0, heat_recovery_target=0.0, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None, hpr_cycle, hpr_utility_total, hpr_work, hpr_external_utility, hpr_ambient_hot, hpr_ambient_cold, hpr_cop, hpr_eta_he, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success, hpr_hot_streams, hpr_cold_streams, hpr_details)[source]
Bases:
GraphBackedTarget,UtilitySummaryTargetBase contract for advanced HPR targets from explicit
target_*methods.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
hpr_cycle (str)
hpr_utility_total (Any)
hpr_work (Any)
hpr_external_utility (Any)
hpr_ambient_hot (Any)
hpr_ambient_cold (Any)
hpr_cop (Any)
hpr_eta_he (Any)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
hpr_success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
hpr_details (Any)
- to_target_results(isTotal=False)[source]
Return the reporting data for explicit HPR target results.
- Parameters:
isTotal (bool)
- Return type:
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.IndirectHeatPumpTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target=0.0, cold_utility_target=0.0, heat_recovery_target=0.0, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None, hpr_cycle, hpr_utility_total, hpr_work, hpr_external_utility, hpr_ambient_hot, hpr_ambient_cold, hpr_cop, hpr_eta_he, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success, hpr_hot_streams, hpr_cold_streams, hpr_details)[source]
Bases:
HeatPumpTargetBaseIndirect heat pump targeting result.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
hpr_cycle (str)
hpr_utility_total (Any)
hpr_work (Any)
hpr_external_utility (Any)
hpr_ambient_hot (Any)
hpr_ambient_cold (Any)
hpr_cop (Any)
hpr_eta_he (Any)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
hpr_success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
hpr_details (Any)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.IndirectRefrigerationTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target=0.0, cold_utility_target=0.0, heat_recovery_target=0.0, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None, hpr_cycle, hpr_utility_total, hpr_work, hpr_external_utility, hpr_ambient_hot, hpr_ambient_cold, hpr_cop, hpr_eta_he, hpr_operating_cost=None, hpr_capital_cost=None, hpr_annualized_capital_cost=None, hpr_total_annualized_cost=None, hpr_compressor_capital_cost=None, hpr_heat_exchanger_capital_cost=None, hpr_success, hpr_hot_streams, hpr_cold_streams, hpr_details)[source]
Bases:
HeatPumpTargetBaseIndirect refrigeration targeting result.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
hpr_cycle (str)
hpr_utility_total (Any)
hpr_work (Any)
hpr_external_utility (Any)
hpr_ambient_hot (Any)
hpr_ambient_cold (Any)
hpr_cop (Any)
hpr_eta_he (Any)
hpr_operating_cost (Any)
hpr_capital_cost (Any)
hpr_annualized_capital_cost (Any)
hpr_total_annualized_cost (Any)
hpr_compressor_capital_cost (Any)
hpr_heat_exchanger_capital_cost (Any)
hpr_success (bool)
hpr_hot_streams (StreamCollection)
hpr_cold_streams (StreamCollection)
hpr_details (Any)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.TotalProcessTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target, cold_utility_target, heat_recovery_target, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None)[source]
Bases:
UtilitySummaryTargetAggregated process-level utility summary built from solved subzones.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.TotalSiteTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target, cold_utility_target, heat_recovery_target, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None, graphs=<factory>, pt, work_target=None, turbine_efficiency_target=None)[source]
Bases:
GraphBackedTarget,UtilitySummaryTargetTotal Site / indirect integration target with site Problem Tables and graphs.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
pt (ProblemTable)
work_target (float | None)
turbine_efficiency_target (float | None)
- to_target_results(isTotal=False)[source]
Return the reporting data including Total Site work fields.
- Parameters:
isTotal (bool)
- Return type:
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.targets.UtilitySummaryTarget(*, zone_name=None, period_id=None, period_idx=None, name, type, parent_zone=None, config=<factory>, active=True, hot_utilities=<factory>, cold_utilities=<factory>, hot_utility_target, cold_utility_target, heat_recovery_target, heat_recovery_limit=None, degree_of_int=None, utility_cost=0.0, hot_pinch=None, cold_pinch=None, process_component_work_target=None, exergy_sinks=None, exergy_sources=None, exergy_des_min=None, exergy_req_min=None, ETE=None)[source]
Bases:
BaseTargetModelTarget that returns utility duties and recovered-heat summaries.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
zone_name (str | None)
period_id (str | None)
period_idx (int | None)
name (str)
type (str)
parent_zone (Any)
config (Configuration)
active (bool)
hot_utilities (StreamCollection)
cold_utilities (StreamCollection)
hot_utility_target (float)
cold_utility_target (float)
heat_recovery_target (float)
heat_recovery_limit (float | None)
degree_of_int (float | None)
utility_cost (float)
hot_pinch (float | None)
cold_pinch (float | None)
process_component_work_target (float | None)
exergy_sinks (float | None)
exergy_sources (float | None)
exergy_des_min (float | None)
exergy_req_min (float | None)
ETE (float | None)
- property utility_streams: StreamCollection
Return hot and cold utilities as one combined collection.
- calc_utility_cost()[source]
Calculate and cache the total utility cost across attached utilities.
- Return type:
- to_target_results(isTotal=False)[source]
Return the common reporting data for utility-summary targets.
- Parameters:
isTotal (bool)
- Return type:
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Schemas for turbine solve outputs.
- class OpenPinch.lib.schemas.turbine.TurbineSolveResult(*, mode, turbine_model, load_frac, mech_eff, min_eff, is_high_p_cond_flash, total_work, total_isentropic_work, overall_efficiency, total_process_duty, steam_mass_flow_in=None, inlet_pressure=None, inlet_temperature=None, sink_pressure=None, sink_temperature=None, stage_temperatures=<factory>, stage_heat_flows=<factory>, stages=<factory>)[source]
Bases:
BaseModelValidated output for a multi-stage turbine targeting solve.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
mode (str)
turbine_model (str)
load_frac (float)
mech_eff (float)
min_eff (float)
is_high_p_cond_flash (bool)
total_work (float)
total_isentropic_work (float)
overall_efficiency (float)
total_process_duty (float)
steam_mass_flow_in (float | None)
inlet_pressure (float | None)
inlet_temperature (float | None)
sink_pressure (float | None)
sink_temperature (float | None)
stages (List[TurbineStageResult])
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OpenPinch.lib.schemas.turbine.TurbineStageResult(*, stage, source_index, stage_type, temperature, process_duty, pressure_in, pressure_out, mass_flow_in, mass_flow_extracted, mass_flow_out, enthalpy_in, enthalpy_out, condensate_enthalpy, saturation_enthalpy, dh_isentropic, work_actual, work_isentropic, isentropic_efficiency, turbine_model)[source]
Bases:
BaseModelDetailed result for one solved turbine stage.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
stage (int)
source_index (int)
stage_type (str)
temperature (float)
process_duty (float)
pressure_in (float)
pressure_out (float)
mass_flow_in (float)
mass_flow_extracted (float)
mass_flow_out (float)
enthalpy_in (float)
enthalpy_out (float)
condensate_enthalpy (float)
saturation_enthalpy (float)
dh_isentropic (float)
work_actual (float)
work_isentropic (float)
isentropic_efficiency (float)
turbine_model (str)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].