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 |
LakeWaterHeatExchanger_T_Cooling
|
Validation model for lake water heat exchanger in which it provides cooling |
LakeWaterHeatExchanger_T_Heating
|
Validation model for lake water heat exchanger in which it provides heating |
Plant_Carnot_T_ClosedLoop
|
Validation model for plant with ideal temperature control and vapor compression engines |
Plant_T
|
Validation model for plant with ideal temperature control |
Plant_T_ClosedLoop
|
Validation model for plant with ideal temperature control |
Validation model for lake water heat exchanger in which it provides 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
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | 100 | Nominal mass flow rate [kg/s] |
Modelica definition
Validation model for lake water heat exchanger in which it provides 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
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | 100 | Nominal mass flow rate [kg/s] |
Ramp | TWatCol | redeclare Modelica.Blocks.So... | Water temperature |
Constant | TWatWar | redeclare Modelica.Blocks.So... | Water temperature |
Modelica definition
model LakeWaterHeatExchanger_T_Heating
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal = 100
;
LakeWaterHeatExchanger_T hex(
redeclare package Medium = Medium,
dpHex_nominal=10000,
m_flow_nominal=m_flow_nominal) ;
Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 16)
;
Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 8)
;
Buildings.Fluid.Sources.Boundary_pT bou(
redeclare package Medium = Medium,
nPorts=1,
use_T_in=true,
T=277.15) ;
Buildings.Fluid.Sources.MassFlowSource_T floSou(
redeclare package Medium = Medium,
use_T_in=true,
use_m_flow_in=true,
nPorts=1) ;
replaceable Modelica.Blocks.Sources.Ramp TWatCol(
height=-10,
duration=900,
offset=273.15 + 20)
constrainedby Modelica.Blocks.Interfaces.SO
;
Modelica.Blocks.Sources.Ramp m_flow(
duration=900,
height=-2*m_flow_nominal,
offset=m_flow_nominal,
startTime=1800 + 900) ;
Buildings.Fluid.Sensors.TemperatureTwoPort temWar(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
tau=0) ;
Buildings.Fluid.Sensors.TemperatureTwoPort temCol(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
tau=0) ;
replaceable Modelica.Blocks.Sources.Constant TWatWar(k=273.15 + 4)
constrainedby Modelica.Blocks.Interfaces.SO ;
Modelica.Blocks.Sources.Constant TWatSou(k=273.15 + 15)
;
Modelica.Blocks.Sources.Constant
TSouHea(k=273.15 + 20)
;
Modelica.Blocks.Sources.Constant TSouCoo(k=273.15 + 18)
;
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;
Validation model for plant with ideal temperature control and vapor compression engines
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
Type | Name | Default | Description |
HeatFlowRate | Q_flow_nominal | 10E3 | Nominal heat flow rate, positive for heating, negative for cooling [W] |
Design parameter |
Temperature | TSetHeaLea | 273.15 + 8 | Set point for leaving fluid temperature warm supply [K] |
Temperature | TSetCooLea | 273.15 + 14 | Set point for leaving fluid temperature cold supply [K] |
Pressure | dp_nominal | 30000 | Pressure difference at nominal flow rate [Pa] |
TemperatureDifference | dT_nominal | TSetCooLea - TSetHeaLea | Temperature difference between warm and cold pipe [K] |
Modelica definition
model Plant_Carnot_T_ClosedLoop
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 10E3
;
parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8
;
parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14
;
parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000
;
parameter Modelica.SIunits.TemperatureDifference dT_nominal(
min=0.5,
displayUnit="K") = TSetCooLea-TSetHeaLea
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal
;
HeatingCoolingCarnot_T pla(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT pre(
redeclare package Medium = Medium,
nPorts=1) ;
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) ;
Modelica.Blocks.Sources.Pulse pulse(period=86400, offset=-0.5);
Modelica.Blocks.Math.Gain Q_flow(k=-4200) ;
Modelica.Blocks.Math.Gain m_flow(k=-m_flow_nominal) ;
Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaFlo
;
Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12)
;
Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16)
;
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"))
;
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;
Validation model for plant with ideal temperature control
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
Type | Name | Default | Description |
HeatFlowRate | Q_flow_nominal | 1E6 | Nominal heat flow rate, positive for heating, negative for cooling [W] |
Design parameter |
Temperature | TSetHeaLea | 273.15 + 8 | Set point for leaving fluid temperature warm supply [K] |
Temperature | TSetCooLea | 273.15 + 14 | Set point for leaving fluid temperature cold supply [K] |
Pressure | dp_nominal | 30000 | Pressure difference at nominal flow rate [Pa] |
TemperatureDifference | dT_nominal | TSetCooLea - TSetHeaLea | Temperature difference between warm and cold pipe [K] |
Modelica definition
model Plant_T
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 1E6
;
parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8
;
parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14
;
parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000
;
parameter Modelica.SIunits.TemperatureDifference dT_nominal(
min=0.5,
displayUnit="K") = TSetCooLea-TSetHeaLea
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal
;
Ideal_T pla(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sources.MassFlowSource_T war(
redeclare package Medium = Medium,
use_T_in=true,
use_m_flow_in=true,
nPorts=1) ;
Buildings.Fluid.Sources.Boundary_pT coo(
redeclare package Medium = Medium,
use_T_in=true,
nPorts=1) ;
Modelica.Blocks.Sources.Ramp TWar(
height=6,
duration=86400,
offset=273.15 + 12) ;
Modelica.Blocks.Sources.Ramp TCoo(
duration=86400,
height=12,
offset=273.15 + 4) ;
Modelica.Blocks.Sources.Ramp m_flow(
duration=86400,
height=2*m_flow_nominal,
offset=-m_flow_nominal) ;
protected
Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12)
;
Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16)
;
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;
Validation model for plant with ideal temperature control
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
Type | Name | Default | Description |
HeatFlowRate | Q_flow_nominal | 10E3 | Nominal heat flow rate, positive for heating, negative for cooling [W] |
Design parameter |
Temperature | TSetHeaLea | 273.15 + 8 | Set point for leaving fluid temperature warm supply [K] |
Temperature | TSetCooLea | 273.15 + 14 | Set point for leaving fluid temperature cold supply [K] |
Pressure | dp_nominal | 30000 | Pressure difference at nominal flow rate [Pa] |
TemperatureDifference | dT_nominal | TSetCooLea - TSetHeaLea | Temperature difference between warm and cold pipe [K] |
Modelica definition
model Plant_T_ClosedLoop
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 10E3
;
parameter Modelica.SIunits.Temperature TSetHeaLea = 273.15+8
;
parameter Modelica.SIunits.Temperature TSetCooLea = 273.15+14
;
parameter Modelica.SIunits.Pressure dp_nominal(displayUnit="Pa")=30000
;
parameter Modelica.SIunits.TemperatureDifference dT_nominal(
min=0.5,
displayUnit="K") = TSetCooLea-TSetHeaLea
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/4200/dT_nominal
;
Ideal_T pla(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT pre(
redeclare package Medium = Medium,
nPorts=1) ;
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) ;
Modelica.Blocks.Sources.Pulse pulse(period=86400, offset=-0.5);
Modelica.Blocks.Math.Gain Q_flow(k=-4200) ;
Modelica.Blocks.Math.Gain m_flow(k=-m_flow_nominal) ;
Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaFlo
;
protected
Modelica.Blocks.Sources.Constant TSetH(k=273.15 + 12)
;
Modelica.Blocks.Sources.Constant TSetC(k=273.15 + 16)
;
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;