modelTableData2DLoadDepSHC1Only

Example of a primary-only plant with four-pipe heat pump

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This model illustrates the use of Buildings.Fluid.HeatPumps.ModularReversible.TableData2DLoadDepSHC to model a primary-only heating and cooling plant. The simulation covers a 24-hour period with overlapping heating and cooling loads. The heating loads reach their peak value first, the cooling loads reach it last.

The plant model includes the following components.

  • Modular four-pipe heat pump with three units
  • HW and CHW isolation valves represented by an equivalent actuator
  • Three headered variable-speed primary HW and CHW pumps
  • HW and CHW minimum flow bypass valves

A unique aggregated load is modeled on each loop by means of a cooling or heating component controlled to maintain a constant ΔT and a modulating valve controlled to track a prescribed flow rate.

The closed-loop controls includes the following logic.

  • Heating and cooling plant enable: See Buildings.Templates.Plants.Controls.Enabling.Enable.
    The HW and CHW plant requests used in this logic are generated based on an opening threshold of 10 % of the equivalent terminal valves.
  • Heat pump operating mode: When the heating plant is enabled and the cooling plant is disabled, the heat pump is commanded in heating-only mode. When the cooling plant is enabled and the heating plant is disabled, the heat pump is commanded in cooling-only mode. When both the cooling plant and the heating plant are enabled, the heat pump is commanded in simultaneous heating and cooling mode. When both the cooling plant and the heating plant are disabled, the heat pump is commanded off.
  • HW and CHW supply temperature: The heat pump is controlled with constant setpoints equal to the design values.
  • Primary HW and CHW pumps controlled to maintain a remote differential pressure setpoint: See Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeadered for the staging and rotation logic, and Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure for the control logic.
  • Minimum flow HW and CHW bypass valves controlled to maintain the differential pressure across the heat pump HW and CHW headers at design value.

Simulating this model shows how the plant responds to a varying load by

  • enabling or disabling the heating and cooling plants, and switching the heat pump operating mode accordingly,
  • staging or unstaging the heat pump modules in various modes,
  • actuating the corresponding isolation valves,
  • staging, rotating and controlling the primary pumps to meet the remote differential pressure setpoint.
  • modulating the minimum flow bypass valve to keep the header differential pressure at its design value, which, in conjunction with the isolation valves' control, effectively results in a flowrate through the heat pump heat exchangers varying linearly with the number of enabled modules on each loop.

Parameters

TypeNameDefaultDescription
Data.TableData2DLoadDepSHC.GenericdatPerformance data
Nominal condition
Modelica.Units.SI.HeatFlowRateQHea_flow_nominal1500E3Heating heat flow rate
Modelica.Units.SI.HeatFlowRateQCoo_flow_nominal-1500E3Cooling heat flow rate
Modelica.Units.SI.MassFlowRatemHw_flow_nominalabs(QHea_flow_nominal/(THwSup_nominal - THwRet_nominal))/Buildings.Utilities.Psychrometrics.Constants.cpWatLiqHW mass flow rate
Modelica.Units.SI.MassFlowRatemChw_flow_nominalabs(QCoo_flow_nominal/(TChwSup_nominal - TChwRet_nominal))/Buildings.Utilities.Psychrometrics.Constants.cpWatLiqCHW mass flow rate
Modelica.Units.SI.TemperatureTHwSup_nominalBuildings.Templates.Data.Defaults.THeaWatSupMedHW supply temperature
Modelica.Units.SI.TemperatureTChwSup_nominalBuildings.Templates.Data.Defaults.TChiWatSupCHW supply temperature
Modelica.Units.SI.TemperatureTHwRet_nominalBuildings.Templates.Data.Defaults.THeaWatRetMedHW return temperature
Modelica.Units.SI.TemperatureTChwRet_nominalBuildings.Templates.Data.Defaults.TChiWatRetCHW return temperature
Modelica.Units.SI.PressureDifferencedpHwRemSet_maxBuildings.Templates.Data.Defaults.dpHeaWatRemSet_maxMaximum HW differential pressure setpoint - At remote location
Modelica.Units.SI.PressureDifferencedpChwRemSet_maxBuildings.Templates.Data.Defaults.dpChiWatRemSet_maxMaximum CHW differential pressure setpoint - At remote location
Modelica.Units.SI.PressureDifferencedpHwLocSet_maxBuildings.Templates.Data.Defaults.dpHeaWatLocSet_maxMaximum HW differential pressure setpoint - local to the plant
Modelica.Units.SI.PressureDifferencedpChwLocSet_maxBuildings.Templates.Data.Defaults.dpChiWatLocSet_maxMaximum CHW differential pressure setpoint - local to the plant
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamicsModelica.Fluid.Types.Dynamics.FixedInitialType of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDefaultDescription
Templates.Components.Interfaces.BusbusPumChwPriPrimary CHW pump control bus
Templates.Components.Interfaces.BusbusPumHwPriPrimary HW pump control bus

Components

TypeNameDefaultDescription
BoundaryConditions.WeatherData.ReaderTMY3weaDatOutdoor conditions
Fluid.HeatExchangers.SensibleCooler_TloaHwHW system approximated by prescribed return temperature
Fluid.HeatExchangers.Heater_TloaChwCHW system system approximated by prescribed return temperature
Fluid.Actuators.Valves.TwoWayEqualPercentagevalDisHwDistribution system approximated by variable flow resistance
Fluid.Actuators.Valves.TwoWayEqualPercentagevalDisChwDistribution system approximated by variable flow resistance
Fluid.Sensors.RelativePressuredpHwRemHW differential pressure at one remote location
Fluid.Sensors.RelativePressuredpChwRemCHW differential pressure at one remote location
Buildings.Controls.OBC.CDL.Reals.Sources.TimeTableratFloSource signal for flow rate ratio – Index 1 for HW, 2 for CHW
Buildings.Controls.OBC.CDL.Reals.PID[2]ctlEquZonZone equipment controller
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter[2]norFloNormalize flow rate
Fluid.Sensors.MassFlowRatemChw_flowCHW mass flow rate
Fluid.Sensors.MassFlowRatemHw_flowHW mass flow rate
Buildings.Controls.OBC.CDL.Reals.AddParameterTChwRetPrePrescribed CHW return temperature
Buildings.Controls.OBC.CDL.Reals.AddParameterTHwRetPrePrescribed HW return temperature
Buildings.Controls.OBC.CDL.Reals.Maxmax2Limit prescribed HWRT
Buildings.Controls.OBC.CDL.Reals.Minmin1Limit prescribed CHWRT
Buildings.Fluid.FixedResistances.PressureDroppipHwPiping
Buildings.Fluid.FixedResistances.PressureDroppipChwPiping
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantconConstant limiting prescribed return temperature
Buildings.Fluid.HeatPumps.ModularReversible.TableData2DLoadDepSHChpModular heat pump
Sensors.TemperatureTwoPortTChwSupCHW supply temperature
Sensors.TemperatureTwoPortTHwSupHW supply temperature
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[2]TSupSetSupply temperature setpoints
Sources.Boundary_pTpChwRetPressure boundary conditions at HP inlet
Sources.Boundary_pTpHwRetPressure boundary condition at HP inlet
Actuators.Valves.TwoWayTablevalHwIsoEquivalent actuator for modules' condenser barrels and HW isolation valves
Actuators.Valves.TwoWayTablevalChwIsoEquivalent actuator for modules' evaporator barrels and CHW isolation valves
Buildings.Controls.OBC.CDL.Integers.MultiSumsumNumUniTotal number of enabled modules
Buildings.Controls.OBC.CDL.Utilities.AssertassMesAssert condition on number of enabled modules
Buildings.Controls.OBC.CDL.Integers.LessEqualThresholdintLesEquThrTrue if number of enabled modules lower or equal to number of modules
Sensors.RelativePressuredpChwHeaModule CHW header differential pressure
Sensors.RelativePressuredpHwHeaModule HW header differential pressure
Actuators.Valves.TwoWayLinearvalChwBypCHW minimum flow bypass valve
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[2]dpHeaSetModule header dp setpoint
Buildings.Controls.OBC.Utilities.PIDWithEnablectlValChwBypCHW minimum flow bypass valve controller
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[2]dpRemSetRemote dp setpoint
Sensors.TemperatureTwoPortTHwRetPlaPlant HW return temperature
Sensors.TemperatureTwoPortTChwRetPlaPlant CHW return temperature
Actuators.Valves.TwoWayLinearvalHwBypHW minimum flow bypass valve
Buildings.Controls.OBC.Utilities.PIDWithEnablectlValHwBypHW minimum flow bypass valve controller
Sensors.TemperatureTwoPortTChwRetCHW return temperature
Sensors.TemperatureTwoPortTHwRetHW return temperature
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdvalChwReqCHW plant request from terminal valve
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdvalHwReqHW plant request from terminal valve
Buildings.Controls.OBC.CDL.Conversions.BooleanToIntegerreqHeaHeating plant request
Buildings.Controls.OBC.CDL.Conversions.BooleanToIntegerreqCooCooling plant request
Templates.Plants.Controls.Enabling.EnableenaHeaEnable heating
Templates.Plants.Controls.Enabling.EnableenaCooEnable cooling
Templates.Components.Routing.SingleToMultipleinlPumChwPriPrimary CHW pumps suction header
Templates.Components.Pumps.MultiplepumChwPriPrimary CHW pumps
Templates.Components.Routing.MultipleToSingleoutPumChwPriPrimary CHW pumps discharge header
Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressurectlPumChwPriPrimary CHW pump control
Sensors.VolumeFlowRateVChwPriPrimary CHW flow (plant side)
Templates.Plants.Controls.Pumps.Generic.StagingHeaderedstaPumChwPriPrimary CHW pump staging
Templates.Components.Routing.SingleToMultipleinlPumHwPriPrimary HW pumps suction header
Templates.Components.Pumps.MultiplepumHwPriPrimary HW pumps
Templates.Components.Routing.MultipleToSingleoutPumHwPriPrimary HW pumps discharge header
Sensors.VolumeFlowRateVHwPriPrimary HW flow (plant side)
Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressurectlPumHwPriPrimary HW pump control
Templates.Plants.Controls.Pumps.Generic.StagingHeaderedstaPumHwPriPrimary HW pump staging
Buildings.Controls.OBC.CDL.Logical.MultiOranyPumHwPriTrue if any primary HW pump is proven on
Buildings.Controls.OBC.CDL.Logical.MultiOranyPumChwPriTrue if any primary CHW pump is proven on
FixedResistances.JunctionjunChwBypSupCHW bypass supply junction
FixedResistances.JunctionjunChwBypRetCHW bypass return junction
FixedResistances.JunctionjunHwBypSupHW bypass supply junction
FixedResistances.JunctionjunHwBypRetHW bypass return junction

Contents

NameDescription
MediumMain medium (common for CHW and HW)

Revisions

  • March 23, 2026, by Antoine Gautier:
    Refactored with two separate connectors for heating and cooling on/off commands.
    This is for #4507.
  • July 1, 2025, by Antoine Gautier:
    First implementation.