Buildings.Experimental.DistrictHeatingCooling.Plants.Validation

Collection of validation models

Information

This package contains models that validate the district heating and cooling plant models. The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Cooling LakeWaterHeatExchanger_T_Cooling Validation model for lake water heat exchanger in which it provides cooling
Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Heating LakeWaterHeatExchanger_T_Heating Validation model for lake water heat exchanger in which it provides heating
Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_Carnot_T_ClosedLoop Plant_Carnot_T_ClosedLoop Validation model for plant with ideal temperature control and vapor compression engines
Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T Plant_T Validation model for plant with ideal temperature control
Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T_ClosedLoop Plant_T_ClosedLoop Validation model for plant with ideal temperature control

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Cooling Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Cooling

Validation model for lake water heat exchanger in which it provides cooling

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Cooling

Information

Validation model in which the inlet water temperature on the warm side of the heat exchanger is gradually increased. Toward the end of the simulation, the water flow through the heat exchanger reverses its direction.

Extends from LakeWaterHeatExchanger_T_Heating (Validation model for lake water heat exchanger in which it provides heating).

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal100Nominal mass flow rate [kg/s]

Modelica definition

model LakeWaterHeatExchanger_T_Cooling "Validation model for lake water heat exchanger in which it provides cooling" extends LakeWaterHeatExchanger_T_Heating( redeclare Modelica.Blocks.Sources.Ramp TWatWar( height=16, duration=900, offset=273.15 + 4), m_flow(height=2*m_flow_nominal, offset=-m_flow_nominal), redeclare Modelica.Blocks.Sources.Constant TWatCol(k=273.15 + 20)); end LakeWaterHeatExchanger_T_Cooling;

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Heating Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Heating

Validation model for lake water heat exchanger in which it provides heating

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.LakeWaterHeatExchanger_T_Heating

Information

Validation model in which the inlet water temperature on the cold side of the heat exchanger is gradually decreased. Toward the end of the simulation, the water flow through the heat exchanger reverses its direction.

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

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal100Nominal mass flow rate [kg/s]
RampTWatColredeclare Modelica.Blocks.So...Water temperature
ConstantTWatWarredeclare Modelica.Blocks.So...Water temperature

Modelica definition

model LakeWaterHeatExchanger_T_Heating "Validation model for lake water heat exchanger in which it provides heating" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Fluid in the pipes"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal = 100 "Nominal mass flow rate"; LakeWaterHeatExchanger_T hex(redeclare package Medium = Medium, dpHex_nominal=10000, m_flow_nominal=m_flow_nominal) "Heat exchanger for free cooling"; Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 16) "Set point temperature for leaving water"; Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 8) "Set point temperature for leaving water"; Buildings.Fluid.Sources.Boundary_pT bou( redeclare package Medium = Medium, nPorts=1, use_T_in=true, T=277.15) "Boundary condition"; Buildings.Fluid.Sources.MassFlowSource_T floSou( redeclare package Medium = Medium, use_T_in=true, use_m_flow_in=true, nPorts=1) "Flow source"; replaceable Modelica.Blocks.Sources.Ramp TWatCol( height=-10, duration=900, offset=273.15 + 20) constrainedby Modelica.Blocks.Interfaces.SO "Water temperature"; Modelica.Blocks.Sources.Ramp m_flow( duration=900, height=-2*m_flow_nominal, offset=m_flow_nominal, startTime=1800 + 900) "Mass flow rate"; Buildings.Fluid.Sensors.TemperatureTwoPort temWar( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, tau=0) "Warm water supply leg temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort temCol( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, tau=0) "Cold water supply leg temperature"; replaceable Modelica.Blocks.Sources.Constant TWatWar(k=273.15 + 4) constrainedby Modelica.Blocks.Interfaces.SO "Water temperature"; Modelica.Blocks.Sources.Constant TWatSou(k=273.15 + 15) "Ocean water temperature"; Modelica.Blocks.Sources.Constant TSouHea(k=273.15 + 20) "Ambient temperature used to heat up loop"; Modelica.Blocks.Sources.Constant TSouCoo(k=273.15 + 18) "Ambient temperature used to cool loop"; equation connect(hex.TSetHea, TSetH.y); connect(TSetC.y, hex.TSetCoo); connect(hex.port_b2, hex.port_a1); connect(TWatCol.y, floSou.T_in); connect(m_flow.y, floSou.m_flow_in); connect(hex.port_b1, temWar.port_a); connect(temWar.port_b, bou.ports[1]); connect(temCol.port_a, floSou.ports[1]); connect(temCol.port_b, hex.port_a2); connect(TWatWar.y, bou.T_in); connect(TWatSou.y, hex.TSouWat); connect(TSouHea.y, hex.TSouHea); connect(TSouCoo.y, hex.TSouCoo); end LakeWaterHeatExchanger_T_Heating;

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_Carnot_T_ClosedLoop Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_Carnot_T_ClosedLoop

Validation model for plant with ideal temperature control and vapor compression engines

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_Carnot_T_ClosedLoop

Information

This model tests the ideal plant that takes the leaving water temperature setpoint as an input signal and computes the compressor energy using the Carnot cycle analogy. The plant is connected to a control volume to which heat is added or removed. When heat is added, the pump is operated in the reverse flow, otherwise in forward flow. This moves the water in the circuit through the plant in which it is heated or cooled to meet the corresponding set point for the leaving water temperature.

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

Parameters

TypeNameDefaultDescription
HeatFlowRateQ_flow_nominal10E3Nominal heat flow rate, positive for heating, negative for cooling [W]
Design parameter
TemperatureTSetHeaLea273.15 + 8Set point for leaving fluid temperature warm supply [K]
TemperatureTSetCooLea273.15 + 14Set point for leaving fluid temperature cold supply [K]
Pressuredp_nominal30000Pressure difference at nominal flow rate [Pa]
TemperatureDifferencedT_nominalTSetCooLea - TSetHeaLeaTemperature difference between warm and cold pipe [K]

Modelica definition

model Plant_Carnot_T_ClosedLoop "Validation model for plant with ideal temperature control and vapor compression engines" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Fluid in the pipes"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 10E3 "Nominal heat flow rate, positive for heating, negative for cooling"; parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8 "Set point for leaving fluid temperature warm supply"; parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14 "Set point for leaving fluid temperature cold supply"; parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000 "Pressure difference at nominal flow rate"; parameter Modelica.SIunits.TemperatureDifference dT_nominal( min=0.5, displayUnit="K") = TSetCooLea-TSetHeaLea "Temperature difference between warm and cold pipe"; final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal "Nominal mass flow rate"; HeatingCoolingCarnot_T pla( redeclare package Medium = Medium, show_T=true, m_flow_nominal=m_flow_nominal) "Heating and cooling plant"; Buildings.Fluid.Sources.Boundary_pT pre( redeclare package Medium = Medium, nPorts=1) "Pressure source"; Buildings.Fluid.MixingVolumes.MixingVolume vol(nPorts=2, redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, V=0.25*3600*m_flow_nominal/1000); Buildings.Fluid.Movers.FlowControlled_m_flow pum( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, addPowerToMedium=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Pump"; Modelica.Blocks.Sources.Pulse pulse(period=86400, offset=-0.5); Modelica.Blocks.Math.Gain Q_flow(k=-4200) "Heat input to volume"; Modelica.Blocks.Math.Gain m_flow(k=-m_flow_nominal) "Pump mass flow rate"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaFlo "Prescribed heat flow rate"; Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12) "Set point temperature for leaving water"; Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16) "Set point temperature for leaving water"; Modelica.Blocks.Sources.CombiTimeTable TOut(table=[ 0, 273.15+14; 3, 273.15+14; 3, 273.15+0; 6, 273.15+0; 6, 273.15+20; 12, 273.15+20; 12, 273.15+30; 18, 273.15+30; 18, 273.15+20], timeScale=3600, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, y(each displayUnit="degC", each unit="K")) "Outdoor temperature"; equation connect(pre.ports[1], pla.port_a); connect(pla.port_b, pum.port_a); connect(pum.port_b, vol.ports[1]); connect(vol.ports[2], pla.port_a); connect(pulse.y, m_flow.u); connect(m_flow.y, Q_flow.u); connect(heaFlo.Q_flow, Q_flow.y); connect(heaFlo.port, vol.heatPort); connect(m_flow.y, pum.m_flow_in); connect(TSetC.y, pla.TSetCoo); connect(pla.TSetHea, TSetH.y); connect(TOut.y[1], pla.TSink); end Plant_Carnot_T_ClosedLoop;

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T

Validation model for plant with ideal temperature control

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T

Information

This model tests the ideal plant that takes the leaving water temperature setpoint as an input signal.

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

Parameters

TypeNameDefaultDescription
HeatFlowRateQ_flow_nominal1E6Nominal heat flow rate, positive for heating, negative for cooling [W]
Design parameter
TemperatureTSetHeaLea273.15 + 8Set point for leaving fluid temperature warm supply [K]
TemperatureTSetCooLea273.15 + 14Set point for leaving fluid temperature cold supply [K]
Pressuredp_nominal30000Pressure difference at nominal flow rate [Pa]
TemperatureDifferencedT_nominalTSetCooLea - TSetHeaLeaTemperature difference between warm and cold pipe [K]

Modelica definition

model Plant_T "Validation model for plant with ideal temperature control" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Fluid in the pipes"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 1E6 "Nominal heat flow rate, positive for heating, negative for cooling"; parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8 "Set point for leaving fluid temperature warm supply"; parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14 "Set point for leaving fluid temperature cold supply"; parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000 "Pressure difference at nominal flow rate"; parameter Modelica.SIunits.TemperatureDifference dT_nominal( min=0.5, displayUnit="K") = TSetCooLea-TSetHeaLea "Temperature difference between warm and cold pipe"; final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal "Nominal mass flow rate"; Ideal_T pla( redeclare package Medium = Medium, show_T=true, m_flow_nominal=m_flow_nominal) "Heating and cooling plant"; Buildings.Fluid.Sources.MassFlowSource_T war( redeclare package Medium = Medium, use_T_in=true, use_m_flow_in=true, nPorts=1) "Warm pipe"; Buildings.Fluid.Sources.Boundary_pT coo( redeclare package Medium = Medium, use_T_in=true, nPorts=1) "Cool pipe"; Modelica.Blocks.Sources.Ramp TWar( height=6, duration=86400, offset=273.15 + 12) "Temperature of warm supply"; Modelica.Blocks.Sources.Ramp TCoo( duration=86400, height=12, offset=273.15 + 4) "Temperature of cold supply"; Modelica.Blocks.Sources.Ramp m_flow( duration=86400, height=2*m_flow_nominal, offset=-m_flow_nominal) "Mass flow rate in warm pipe"; protected Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12) "Set point temperature for leaving water"; Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16) "Set point temperature for leaving water"; equation connect(TWar.y,war. T_in); connect(TCoo.y, coo.T_in); connect(war.ports[1], pla.port_b); connect(m_flow.y, war.m_flow_in); connect(coo.ports[1], pla.port_a); connect(pla.TSetHea, TSetH.y); connect(TSetC.y, pla.TSetCoo); end Plant_T;

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T_ClosedLoop Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T_ClosedLoop

Validation model for plant with ideal temperature control

Buildings.Experimental.DistrictHeatingCooling.Plants.Validation.Plant_T_ClosedLoop

Information

This model tests the ideal plant that takes the leaving water temperature setpoint as an input signal. The plant is connected to a control volume to which heat is added or removed. When heat is added, the pump is operated in the reverse flow, otherwise in forward flow. This moves the water in the circuit through the plant in which it is heated or cooled to meet the corresponding set point for the leaving water temperature.

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

Parameters

TypeNameDefaultDescription
HeatFlowRateQ_flow_nominal10E3Nominal heat flow rate, positive for heating, negative for cooling [W]
Design parameter
TemperatureTSetHeaLea273.15 + 8Set point for leaving fluid temperature warm supply [K]
TemperatureTSetCooLea273.15 + 14Set point for leaving fluid temperature cold supply [K]
Pressuredp_nominal30000Pressure difference at nominal flow rate [Pa]
TemperatureDifferencedT_nominalTSetCooLea - TSetHeaLeaTemperature difference between warm and cold pipe [K]

Modelica definition

model Plant_T_ClosedLoop "Validation model for plant with ideal temperature control" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Fluid in the pipes"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 10E3 "Nominal heat flow rate, positive for heating, negative for cooling"; parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8 "Set point for leaving fluid temperature warm supply"; parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14 "Set point for leaving fluid temperature cold supply"; parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000 "Pressure difference at nominal flow rate"; parameter Modelica.SIunits.TemperatureDifference dT_nominal( min=0.5, displayUnit="K") = TSetCooLea-TSetHeaLea "Temperature difference between warm and cold pipe"; final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal "Nominal mass flow rate"; Ideal_T pla( redeclare package Medium = Medium, show_T=true, m_flow_nominal=m_flow_nominal) "Heating and cooling plant"; Buildings.Fluid.Sources.Boundary_pT pre( redeclare package Medium = Medium, nPorts=1) "Pressure source"; Buildings.Fluid.MixingVolumes.MixingVolume vol(nPorts=2, redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, V=0.25*3600*m_flow_nominal/1000); Buildings.Fluid.Movers.FlowControlled_m_flow pum( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, addPowerToMedium=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Pump"; Modelica.Blocks.Sources.Pulse pulse(period=86400, offset=-0.5); Modelica.Blocks.Math.Gain Q_flow(k=-4200) "Heat input to volume"; Modelica.Blocks.Math.Gain m_flow(k=-m_flow_nominal) "Pump mass flow rate"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaFlo "Prescribed heat flow rate"; protected Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12) "Set point temperature for leaving water"; Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16) "Set point temperature for leaving water"; equation connect(pre.ports[1], pla.port_a); connect(pla.port_b, pum.port_a); connect(pum.port_b, vol.ports[1]); connect(vol.ports[2], pla.port_a); connect(pulse.y, m_flow.u); connect(m_flow.y, Q_flow.u); connect(heaFlo.Q_flow, Q_flow.y); connect(heaFlo.port, vol.heatPort); connect(m_flow.y, pum.m_flow_in); connect(TSetC.y, pla.TSetCoo); connect(pla.TSetHea, TSetH.y); end Plant_T_ClosedLoop;