modelHeatExchanger
Base subsystem with district heat exchanger
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).
Information
This is a model for a district heat exchanger system with a variable speed pump on the secondary side, and a variable speed pump (in case of a passive network) or a two-way modulating valve (in case of an active network) on the primary side.
The system is controlled based on the logic described in Buildings.Obsolete.DHC.ETS.Combined.Controls.HeatExchanger. The pump flow rate is considered proportional to the pump speed under the assumption of a constant flow resistance in both the primary and the secondary loops.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| DHC.ETS.Types.ConnectionConfiguration | conCon | District connection configuration | |
| Assumptions | |||
| Boolean | allowFlowReversal1 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
| Boolean | allowFlowReversal2 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m1_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.MassFlowRate | m2_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.PressureDifference | dp1Hex_nominal | Nominal pressure drop across heat exchanger on district side | |
| Modelica.Units.SI.PressureDifference | dp2Hex_nominal | Nominal pressure drop across heat exchanger on building side | |
| Modelica.Units.SI.PressureDifference | dpVal1_nominal | dp1Hex_nominal/2 | Nominal pressure drop of primary control valve |
| Modelica.Units.SI.PressureDifference | dpVal2_nominal | dp2Hex_nominal/2 | Nominal pressure drop of secondary control valve |
| Modelica.Units.SI.HeatFlowRate | Q_flow_nominal | Nominal heat flow rate (from district to building) | |
| Modelica.Units.SI.Temperature | T_a1_nominal | Nominal water inlet temperature on district side | |
| Modelica.Units.SI.Temperature | T_b1_nominal | Nominal water outlet temperature on district side | |
| Modelica.Units.SI.Temperature | T_a2_nominal | Nominal water inlet temperature on building side | |
| Modelica.Units.SI.Temperature | T_b2_nominal | Nominal water outlet temperature on building side | |
| Advanced | |||
| Medium1.MassFlowRate | m1_flow_small (from PartialFourPortInterface) | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Medium2.MassFlowRate | m2_flow_small (from PartialFourPortInterface) | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialFourPortInterface) | false | = true, if actual temperature at port is computed |
| Controls | |||
| Real | spePum1Min | 0.1 | Heat exchanger primary pump minimum speed (fractional) |
| Real | spePum2Min | 0.1 | Heat exchanger secondary pump minimum speed (fractional) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a1 (from PartialFourPort) | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b1 (from PartialFourPort) | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_a | port_a2 (from PartialFourPort) | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b2 (from PartialFourPort) | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | on | Control signal for secondary side (from supervisory). Set to true to operate subsystem | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | PPum | Power drawn by pump motors |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Medium1.MassFlowRate | m1_flow (from PartialFourPortInterface) | port_a1.m_flow | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp1 (from PartialFourPortInterface) | port_a1.p - port_b1.p | Pressure difference between port_a1 and port_b1 |
| Medium2.MassFlowRate | m2_flow (from PartialFourPortInterface) | port_a2.m_flow | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp2 (from PartialFourPortInterface) | port_a2.p - port_b2.p | Pressure difference between port_a2 and port_b2 |
| Medium1.ThermodynamicState | sta_a1 (from PartialFourPortInterface) | if allowFlowReversal1 then Medium1.setState_phX(port_a1.p, noEvent(actualStream(port_a1.h_outflow)), noEvent(actualStream(port_a1.Xi_outflow))) else Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow)) | Medium properties in port_a1 |
| Medium1.ThermodynamicState | sta_b1 (from PartialFourPortInterface) | if allowFlowReversal1 then Medium1.setState_phX(port_b1.p, noEvent(actualStream(port_b1.h_outflow)), noEvent(actualStream(port_b1.Xi_outflow))) else Medium1.setState_phX(port_b1.p, port_b1.h_outflow, port_b1.Xi_outflow) | Medium properties in port_b1 |
| Medium2.ThermodynamicState | sta_a2 (from PartialFourPortInterface) | if allowFlowReversal2 then Medium2.setState_phX(port_a2.p, noEvent(actualStream(port_a2.h_outflow)), noEvent(actualStream(port_a2.Xi_outflow))) else Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow)) | Medium properties in port_a2 |
| Medium2.ThermodynamicState | sta_b2 (from PartialFourPortInterface) | if allowFlowReversal2 then Medium2.setState_phX(port_b2.p, noEvent(actualStream(port_b2.h_outflow)), noEvent(actualStream(port_b2.Xi_outflow))) else Medium2.setState_phX(port_b2.p, port_b2.h_outflow, port_b2.Xi_outflow) | Medium properties in port_b2 |
| Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU | hex | Heat exchanger | |
| DHC.ETS.BaseClasses.Pump_m_flow | pum1 | District heat exchanger primary pump | |
| DHC.ETS.BaseClasses.Pump_m_flow | pum2 | Secondary pump | |
| Buildings.Fluid.Sensors.TemperatureTwoPort | senT2WatEnt | Heat exchanger secondary water entering temperature | |
| Buildings.Fluid.Sensors.TemperatureTwoPort | senT2WatLvg | Heat exchanger secondary water leaving temperature | |
| Fluid.Actuators.Valves.TwoWayPressureIndependent | val1 | Heat exchanger primary control valve | |
| Buildings.Controls.OBC.CDL.Reals.MultiSum | totPPum | Total pump power | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | mPum1_flow | Set mass flow rate of pump 1 | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | mPum2_flow2 | Set mass flow rate of pump 2 | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | yVal | Control signal for valves |
Revisions
-
November 14, 2025, by Michael Wetter:
Refactored implementation.
This is for #4354. -
March 27, 2024, by David Blum:
Update icon.
This is for issue #3606. -
July 14, 2021, by Antoine Gautier:
Refactored after updating the control logic, changed the primary control valve to pressure-independent.
This is for issue #2561. -
July 31, 2020, by Antoine Gautier:
First implementation.