echo.models.thermal package
- class echo.models.thermal.ParameterisedChiller(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, max_output: float | None = None, min_output: float | None = None, max_input: float | None = None, min_input: float | None = None, input_port_ref: str = 'input', output_port_ref: str = 'output', input_points: dict | None = None, output_points: dict | None = None, input_points_ref: str | None = None, output_points_ref: str | None = None, partial_load_cop: dict = {0: 0, 0.25: 0.8, 0.5: 0.9, 0.75: 1, 1: 0.85}, temperature_dependent_cop: dict = {0: 0.7, 10: 1, 20: 0.5, 30: 0.35, 45: 0.2}, ambient_temperature_dict: dict = NOTHING, ambient_temperature_ref: str | None = None, constant_ambient_temperature: float = 10, input_port_unit: Units = Units.KW, output_port_unit: Units = Units.KWT, heat_rejection_port: bool = False, heat_rejection_coefficient: float = 1, heat_rejection_port_ref: str = 'heat_rejection', *, nominal_cop: float, max_cooling_capacity: float)
Bases:
TimeVaryingPiecewiseIONodeA chiller has one electrical input port and one cooling output (thermal sink) port.
ParameterisedChiller is an input/output piecewise node, with a single set of input/output breakpoints representing chiller COP (Coefficient Of Performance = Output/Input=Cooling_delivered/Electricity_consumed) used for all time periods.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- ambient_temperature_dict: dict
- ambient_temperature_ref: str | None
- constant_ambient_temperature: float
- property electrical_input_port_ref: str
- heat_rejection_coefficient: float
- heat_rejection_port: bool
- heat_rejection_port_ref: str
- max_cooling_capacity: float
- nominal_cop: float
- partial_load_cop: dict
- set_ports(electrical_input_port: FlexSink, cooling_output_port: FlexPort, heat_rejection_port: FlexPort | None = None) None
- property temperature_cop_param: str
- temperature_dependent_cop: dict
- property thermal_output_port_ref: str
- update(ambient_temperature_dict: dict[float, float]) None
- class echo.models.thermal.ParameterisedHeatPump(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, nominal_heating_cop: float = 1, nominal_cooling_cop: float = 1, partial_load_cop_heating: dict = {0: 0, 0.25: 0.8, 0.5: 0.9, 0.75: 1, 1: 0.85}, partial_load_cop_cooling: dict = {0: 0, 0.25: 0.8, 0.5: 0.9, 0.75: 1, 1: 0.85}, temperature_dependent_cop_heating: dict = {-10: 0.4, 0: 0.6, 10: 0.7, 20: 0.9, 30: 1, 45: 1}, temperature_dependent_cop_cooling: dict = {0: 0.7, 10: 1, 20: 0.5, 30: 0.35, 45: 0.2}, ambient_temperature_dict: dict = NOTHING, ambient_temperature_ref: str | None = None, constant_ambient_temperature: float = 10, heat_intake_rejection_port: bool = False, heat_intake_rejection_coefficient: float = 1, input_points_cooling: dict | None = None, output_points_cooling: dict | None = None, input_points_heating: dict | None = None, output_points_heating: dict | None = None, electrical_input_port_ref: str = 'input', thermal_output_port_ref: str = 'output', heat_intake_rejection_port_ref: str = 'heat_intake_rejection', *, max_heating_capacity: float, max_cooling_capacity: float)
Bases:
NodeA Parameterised heat pump model.
This model is different to simple heatpump model in that it uses piecewise linear partial load COP factor (coefficient of performance) and piecewise linear temperature COP factor to calculate actual values for heating and cooling at each step.
HeatPumpTwoPipe has one input electrical port and one bidirectional thermal port. The heat pump can do heating or cooling, but not both simultaneously.
The conversion of input electrical energy to heating or cooling output depends on calculated coefficients of performance (COP) at each time step.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Set up variables and parameters associated with the node
- ambient_temperature_dict: dict
- ambient_temperature_ref: str | None
- apply_node_constraints(model: EchoConcreteModel) None
Set up constraints associated with the node
- constant_ambient_temperature: float
- create_ports() None
- electrical_input_port_ref: str
- heat_intake_rejection_coefficient: float
- heat_intake_rejection_port: bool
- heat_intake_rejection_port_ref: str
- input_points_cooling: dict | None
- input_points_heating: dict | None
- max_cooling_capacity: float
- max_heating_capacity: float
- nominal_cooling_cop: float
- nominal_heating_cop: float
- output_points_cooling: dict | None
- output_points_heating: dict | None
- partial_load_cop_cooling: dict
- partial_load_cop_heating: dict
- property power_to_cool: str
- property power_to_heat: str
- set_ports(electrical_input_port: FlexSink, thermal_output_port: FlexPort, heat_intake_rejection_port: FlexPort | None = None) None
- property temperature_cop_cooling_param: str
- property temperature_cop_heating_param: str
- temperature_dependent_cop_cooling: dict
- temperature_dependent_cop_heating: dict
- thermal_output_port_ref: str
- update(ambient_temperature_dict: dict[float, float]) None
- class echo.models.thermal.SimpleChiller(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, max_cooling_capacity: float | None = None, cooling_cop_time_series: dict | None = None, cooling_cop_time_series_ref: str | None = None, cooling_cop_constant: float = 1, electrical_input_port_ref: str = 'input', thermal_output_port_ref: str = 'output')
Bases:
NodeA simple chiller model that uses predefined COP (coefficient of performance) values for cooling.
Simple Chiller has one input electrical port, and one cooling_output (thermal Sink) thermal port.
The conversion of input electrical energy to cooling output depends on provided coefficients of performance (COP) time series data.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- apply_node_constraints(model: EchoConcreteModel) None
Apply constraints associated with this node to a concrete model.
Intended to be overridden in subclasses.
Define constraints as functions that returns a Constraint, EqualityExpression or InequalityExpression.
Define a subfunction of the form detailed in the example below, then apply with setattr. For example:
- def apply_node_constraints(self, model: EchoConcreteModel) -> None:
- def tellegen_node_rule(model: EchoConcreteModel, p: int, t:int) -> EqualityExpression:
a = 0 for port in node_ports.values():
a += getattr(model, port.port_name)[p, t]
return a == 0
node_ports = self.ports con_name = “reliability_con_” + self.node_name setattr(model, con_name, en.Constraint(model.Expansion, model.Time, rule=tellegen_node_rule))
- Parameters:
model – The model to add the constraints to.
- Returns:
None
- property cooling_cop: str
- cooling_cop_constant: float
- cooling_cop_time_series: dict | None
- cooling_cop_time_series_ref: str | None
- electrical_input_port_ref: str
- max_cooling_capacity: float | None
- thermal_output_port_ref: str
- update(cooling_cop_time_series: dict[float, float]) None
- class echo.models.thermal.SimpleHeatPump(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, max_cooling_capacity: float | None = None, max_heating_capacity: float | None = None, heating_cop_time_series: dict | None = None, cooling_cop_time_series: dict | None = None, heating_cop_time_series_ref: str | None = None, cooling_cop_time_series_ref: str | None = None, cooling_cop_constant: float = 1, heating_cop_constant: float = 1, electrical_input_port_ref: str = 'input', thermal_output_port_ref: str = 'output')
Bases:
NodeA simple heat pump model that uses predefined COP (coefficient of performance) values for heating and cooling.
SimpleHeatPump has one input electrical port, and one bidirectional thermal port. In this configuration the heatpump can do heating or cooling, but not both simultaneously.
The conversion of input electrical energy to heating or cooling output depends on provided coefficients of performance (COP) time series data.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- apply_node_constraints(model: EchoConcreteModel) None
Apply constraints associated with this node to a concrete model.
Intended to be overridden in subclasses.
Define constraints as functions that returns a Constraint, EqualityExpression or InequalityExpression.
Define a subfunction of the form detailed in the example below, then apply with setattr. For example:
- def apply_node_constraints(self, model: EchoConcreteModel) -> None:
- def tellegen_node_rule(model: EchoConcreteModel, p: int, t:int) -> EqualityExpression:
a = 0 for port in node_ports.values():
a += getattr(model, port.port_name)[p, t]
return a == 0
node_ports = self.ports con_name = “reliability_con_” + self.node_name setattr(model, con_name, en.Constraint(model.Expansion, model.Time, rule=tellegen_node_rule))
- Parameters:
model – The model to add the constraints to.
- Returns:
None
- property cooling_cop: str
- cooling_cop_constant: float
- cooling_cop_time_series: dict | None
- cooling_cop_time_series_ref: str | None
- create_ports() None
- electrical_input_port_ref: str
- property heating_cop: str
- heating_cop_constant: float
- heating_cop_time_series: dict | None
- heating_cop_time_series_ref: str | None
- max_cooling_capacity: float | None
- max_heating_capacity: float | None
- property power_to_cool: str
- property power_to_heat: str
- thermal_output_port_ref: str
- update(heating_cop_time_series: dict[float, float], cooling_cop_time_series: dict[float, float]) None
- class echo.models.thermal.SimpleHeatPumpDualOutput(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, max_cooling_capacity: float | None = None, max_heating_capacity: float | None = None, heating_cop_time_series: dict | None = None, cooling_cop_time_series: dict | None = None, heating_cop_time_series_ref: str | None = None, cooling_cop_time_series_ref: str | None = None, cooling_cop_constant: float = 1, heating_cop_constant: float = 1, thermal_output_port_ref: str = 'output', waste_heat_recovery_coeff: float = 1, electrical_input_port_ref: str = 'input', cooling_output_port_ref: str = 'cooling_output', heating_output_port_ref: str = 'heating_output')
Bases:
SimpleHeatPumpA simple dual output (four-pipe) heatpump model that uses predefined COP values for heating and cooling.
SimpleHeatPumpDualOutput has one input electrical port and two thermal ports: cooling_output (thermal Sink) and heating_output (thermal Source). In dual output configuration the heatpump can do heating and cooling simultaneously and independently. When heating and cooling simultaneously, the waste heat from cooling loop can be used in the heating loop.
The conversion of input electrical energy to heating or cooling output depends on provided coefficients of performance (COP) time series data.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- apply_node_constraints(model: EchoConcreteModel) None
Apply constraints associated with this node to a concrete model.
Intended to be overridden in subclasses.
Define constraints as functions that returns a Constraint, EqualityExpression or InequalityExpression.
Define a subfunction of the form detailed in the example below, then apply with setattr. For example:
- def apply_node_constraints(self, model: EchoConcreteModel) -> None:
- def tellegen_node_rule(model: EchoConcreteModel, p: int, t:int) -> EqualityExpression:
a = 0 for port in node_ports.values():
a += getattr(model, port.port_name)[p, t]
return a == 0
node_ports = self.ports con_name = “reliability_con_” + self.node_name setattr(model, con_name, en.Constraint(model.Expansion, model.Time, rule=tellegen_node_rule))
- Parameters:
model – The model to add the constraints to.
- Returns:
None
- cooling_output_port_ref: str
- create_ports() None
- property delta_heat_flow: str
- electrical_input_port_ref: str
- property heating_out_adjusted: str
heating_out_adjusted variable represents amount of heat that is produced running the primary heating loop.
- heating_output_port_ref: str
- property recovered_waste_heat: str
- set_ports(electrical_input_port: FlexSink, cooling_output_port: FlexSink, heating_output_port: FlexSource) None
- waste_heat_recovery_coeff: float
- class echo.models.thermal.ThermalStorage(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: en.numeric_expr.NumericExpression | float = 0, charging_power_limit: float | None = None, discharging_power_limit: float | None = None, ambient_temp: dict | None = None, ambient_temp_ref: str | None = None, ins_transmittance: float = 0, surface_area: float = 0, initial_temp: float | None = None, optimised_capacity: bool = False, enforce_end_temperature_value: bool = True, energy_flow_units: Units = Units.KWT, separate_in_out_ports: bool = False, input_port_ref: str = 'input', output_port_ref: str = 'output', input_output_port_ref: str = 'input_output', *, max_temp: float, min_temp: float, storage_mass: float, specific_heat: float)
Bases:
NodeModel of sensible thermal storage with liquid or solid storage medium.
Thermal storage keeps track of its internal temperature value base. Assumes homogeneous temperature throughout the storage volume.
- add_node_to_model(model: EchoConcreteModel, profile: DataFrame) None
Add this node to a concrete model.
- Parameters:
model – The concrete model to add the node to.
profile – The data associated with this node.
- ambient_temp: dict | None
- ambient_temp_ref: str | None
- charging_power_limit: float | None
- discharging_power_limit: float | None
- property energy_units_conversion: float
- enforce_end_temperature_value: bool
- initial_temp: float | None
- input_output_port_ref: str
- input_port_ref: str
- ins_transmittance: float
- property internal_temp: str
- property lump_capacitance: float
- property lump_conductance: float
- property max_heat_storage_capacity: float
- max_temp: float
- min_temp: float
- property net_loss_gain: str
- optimised_capacity: bool
- output_port_ref: str
- separate_in_out_ports: bool
- set_flow_constraints_one_port() None
- set_flow_constraints_separate_ports() None
- set_port(input_output_port: FlexPort) None
Replaces any existing ports with a combined input output port
- set_ports(input_port: FlexSink, output_port: FlexSource) None
Replaces any existing ports with separate input and output ports
- property soc_constraint: str
- property soc_value: str
- specific_heat: float
- storage_mass: float
- surface_area: float
- update(ambient_temp: dict[tuple[int, int], float]) None
Submodules
- echo.models.thermal.base module
ThermalNodeThermalNode.add_node_to_model()ThermalNode.apply_energy_balance_constraint()ThermalNode.create_and_bound_temp_vars()ThermalNode.external_tempThermalNode.gain_factorThermalNode.gainsThermalNode.initial_internal_tempThermalNode.internal_tempThermalNode.is_gainThermalNode.loss_and_gain_constraints_and_variables()ThermalNode.loss_factorThermalNode.lossesThermalNode.temp_lbThermalNode.temp_to_energy_coefThermalNode.temp_ub
- echo.models.thermal.parameterised_chiller module
ParameterisedChillerParameterisedChiller.add_node_to_model()ParameterisedChiller.ambient_temperature_dictParameterisedChiller.ambient_temperature_refParameterisedChiller.constant_ambient_temperatureParameterisedChiller.electrical_input_port_refParameterisedChiller.heat_rejection_coefficientParameterisedChiller.heat_rejection_portParameterisedChiller.heat_rejection_port_refParameterisedChiller.input_port_unitParameterisedChiller.max_cooling_capacityParameterisedChiller.nominal_copParameterisedChiller.output_port_unitParameterisedChiller.partial_load_copParameterisedChiller.set_ports()ParameterisedChiller.temperature_cop_paramParameterisedChiller.temperature_dependent_copParameterisedChiller.thermal_output_port_refParameterisedChiller.update()
- echo.models.thermal.parameterised_heatpump module
ParameterisedHeatPumpParameterisedHeatPump.add_node_to_model()ParameterisedHeatPump.ambient_temperature_dictParameterisedHeatPump.ambient_temperature_refParameterisedHeatPump.apply_node_constraints()ParameterisedHeatPump.constant_ambient_temperatureParameterisedHeatPump.create_ports()ParameterisedHeatPump.electrical_input_port_refParameterisedHeatPump.heat_intake_rejection_coefficientParameterisedHeatPump.heat_intake_rejection_portParameterisedHeatPump.heat_intake_rejection_port_refParameterisedHeatPump.input_points_coolingParameterisedHeatPump.input_points_heatingParameterisedHeatPump.max_cooling_capacityParameterisedHeatPump.max_heating_capacityParameterisedHeatPump.nominal_cooling_copParameterisedHeatPump.nominal_heating_copParameterisedHeatPump.output_points_coolingParameterisedHeatPump.output_points_heatingParameterisedHeatPump.partial_load_cop_coolingParameterisedHeatPump.partial_load_cop_heatingParameterisedHeatPump.power_to_coolParameterisedHeatPump.power_to_heatParameterisedHeatPump.set_ports()ParameterisedHeatPump.temperature_cop_cooling_paramParameterisedHeatPump.temperature_cop_heating_paramParameterisedHeatPump.temperature_dependent_cop_coolingParameterisedHeatPump.temperature_dependent_cop_heatingParameterisedHeatPump.thermal_output_port_refParameterisedHeatPump.update()
- echo.models.thermal.simple_chiller module
SimpleChillerSimpleChiller.add_node_to_model()SimpleChiller.apply_node_constraints()SimpleChiller.cooling_copSimpleChiller.cooling_cop_constantSimpleChiller.cooling_cop_time_seriesSimpleChiller.cooling_cop_time_series_refSimpleChiller.electrical_input_port_refSimpleChiller.max_cooling_capacitySimpleChiller.set_ports()SimpleChiller.thermal_output_port_refSimpleChiller.update()
- echo.models.thermal.simple_heatpump module
SimpleHeatPumpSimpleHeatPump.add_node_to_model()SimpleHeatPump.apply_node_constraints()SimpleHeatPump.cooling_copSimpleHeatPump.cooling_cop_constantSimpleHeatPump.cooling_cop_time_seriesSimpleHeatPump.cooling_cop_time_series_refSimpleHeatPump.create_ports()SimpleHeatPump.electrical_input_port_refSimpleHeatPump.heating_copSimpleHeatPump.heating_cop_constantSimpleHeatPump.heating_cop_time_seriesSimpleHeatPump.heating_cop_time_series_refSimpleHeatPump.max_cooling_capacitySimpleHeatPump.max_heating_capacitySimpleHeatPump.power_to_coolSimpleHeatPump.power_to_heatSimpleHeatPump.set_ports()SimpleHeatPump.thermal_output_port_refSimpleHeatPump.update()
- echo.models.thermal.simple_heatpump_dualoutput module
SimpleHeatPumpDualOutputSimpleHeatPumpDualOutput.add_node_to_model()SimpleHeatPumpDualOutput.apply_node_constraints()SimpleHeatPumpDualOutput.cooling_output_port_refSimpleHeatPumpDualOutput.create_ports()SimpleHeatPumpDualOutput.delta_heat_flowSimpleHeatPumpDualOutput.electrical_input_port_refSimpleHeatPumpDualOutput.heating_out_adjustedSimpleHeatPumpDualOutput.heating_output_port_refSimpleHeatPumpDualOutput.recovered_waste_heatSimpleHeatPumpDualOutput.set_ports()SimpleHeatPumpDualOutput.waste_heat_recovery_coeff
- echo.models.thermal.storage module
ThermalStorageThermalStorage.add_node_to_model()ThermalStorage.ambient_tempThermalStorage.ambient_temp_refThermalStorage.charging_power_limitThermalStorage.discharging_power_limitThermalStorage.energy_flow_unitsThermalStorage.energy_units_conversionThermalStorage.enforce_end_temperature_valueThermalStorage.initial_tempThermalStorage.input_output_port_refThermalStorage.input_port_refThermalStorage.ins_transmittanceThermalStorage.internal_tempThermalStorage.lump_capacitanceThermalStorage.lump_conductanceThermalStorage.max_heat_storage_capacityThermalStorage.max_tempThermalStorage.min_tempThermalStorage.net_loss_gainThermalStorage.optimised_capacityThermalStorage.output_port_refThermalStorage.separate_in_out_portsThermalStorage.set_flow_constraints_one_port()ThermalStorage.set_flow_constraints_separate_ports()ThermalStorage.set_port()ThermalStorage.set_ports()ThermalStorage.soc_constraintThermalStorage.soc_valueThermalStorage.specific_heatThermalStorage.storage_massThermalStorage.surface_areaThermalStorage.update()