Collection of validation models
Information
This package contains validation models for the classes in
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
Borefield
|
Validation of the base subsystem model with geothermal borefield |
Chiller
|
Validation of the base subsystem model with heat recovery chiller |
HeatExchanger
|
Validation of the base subsystem model with district heat exchanger |
SwitchBox
|
Validation of flow switch box |
Validation of the base subsystem model with geothermal borefield
Information
This model validates
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.Borefield.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Integer | nBorHol | 100 | Number of boreholes (must be a square number) |
Distance | dxy | 6 | Distance in x-axis (and y-axis) between borehole axes [m] |
Example | datBorFie | datBorFie(conDat=Fluid.Geoth... | Borefield design data |
Modelica definition
model Borefield
extends Modelica.Icons.Example;
package Medium=
Buildings.Media.Water
;
parameter Integer nBorHol=100
;
parameter Modelica.SIunits.Distance dxy=6
;
final parameter Modelica.SIunits.Distance cooBor[nBorHol,2]=
.Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.computeCoordinates(
nBorHol,
dxy)
;
Generation5.Subsystems.Borefield borFie(
redeclare final package Medium=Medium,
final datBorFie=datBorFie,
dp_nominal=5E4,
TBorWatEntMax=313.15)
;
Fluid.Sources.Boundary_pT conWat(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Fluid.Sensors.TemperatureTwoPort senTInl(
redeclare final package Medium=Medium,
m_flow_nominal=borFie.pum.m_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senTOut(
redeclare final package Medium=Medium,
m_flow_nominal=borFie.pum.m_flow_nominal)
;
parameter Fluid.Geothermal.Borefields.Data.Borefield.Example datBorFie(
conDat=
Fluid.Geothermal.Borefields.Data.Configuration.Example(
cooBor=cooBor,
dp_nominal=0))
;
Modelica.Blocks.Sources.TimeTable TInlVal(
y(
final unit="K",
displayUnit="degC"),
table=[
0,2;
2,2;
3,15;
7,15;
9,35;
10,45;
11,30;
20,30],
timeScale=1000,
offset=273.15)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer(
k=0)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp u(
duration=1000,
startTime=2500)
;
equation
connect(senTInl.port_b,conWat.ports[1]);
connect(conWat.ports[2],senTOut.port_a);
connect(senTInl.port_a,borFie.port_a);
connect(borFie.port_b,senTOut.port_b);
connect(TInlVal.y,conWat.T_in);
connect(zer.y,borFie.yValIso_actual[2]);
connect(u.y,borFie.u);
connect(u.y,borFie.yValIso_actual[1]);
end Borefield;
Validation of the base subsystem model with heat recovery chiller
Information
This model validates
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.Chiller.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Generic | datChi | datChi(QEva_flow_nominal=-1E... | Chiller performance data |
Modelica definition
model Chiller
extends Modelica.Icons.Example;
package Medium=
Buildings.Media.Water
;
parameter Fluid.Chillers.Data.ElectricEIR.Generic datChi(
QEva_flow_nominal=-1E6,
COP_nominal=3,
PLRMax=1,
PLRMinUnl=0.3,
PLRMin=0.3,
etaMotor=1,
mEva_flow_nominal=30,
mCon_flow_nominal=30,
TEvaLvg_nominal=280.15,
capFunT={1,0,0,0,0,0},
EIRFunT={1,0,0,0,0,0},
EIRFunPLR={1,0,0},
TEvaLvgMin=276.15,
TEvaLvgMax=288.15,
TConEnt_nominal=313.15,
TConEntMin=303.15,
TConEntMax=333.15)
;
Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.Chiller
chi(
redeclare final package Medium=Medium,
final dat=datChi,
dpCon_nominal=15E3,
dpEva_nominal=15E3)
;
Fluid.Sources.Boundary_pT evaWat(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Fluid.Sources.Boundary_pT conWat(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TChiWatSupSet(
k=7+273.15,
y(
final unit="K",
displayUnit="degC"))
;
Fluid.Sensors.TemperatureTwoPort senTHeaWatSup(
redeclare final package Medium=Medium,
m_flow_nominal=datChi.mCon_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senTChiWatSup(
redeclare final package Medium=Medium,
m_flow_nominal=datChi.mEva_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senTHeaWatRet(
redeclare final package Medium=Medium,
m_flow_nominal=datChi.mCon_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senTChiWatRet(
redeclare final package Medium=Medium,
m_flow_nominal=datChi.mEva_flow_nominal)
;
Modelica.Blocks.Sources.BooleanExpression uHea(
y=time < 4000)
;
Modelica.Blocks.Sources.BooleanExpression uCoo(
y=time >= 1000)
;
Modelica.Blocks.Sources.TimeTable THeaWatRet(
y(
final unit="K",
displayUnit="degC"),
table=[
0,44;
2,44;
3,34;
4.5,34;
5,14;
10,14],
timeScale=1000,
offset=273.15)
;
Modelica.Blocks.Sources.TimeTable TChiWatRet(
y(
final unit="K",
displayUnit="degC"),
table=[
0,9;
1,9;
2,14;
3,14;
4,11;
5,11],
timeScale=1000,
offset=273.15)
;
equation
connect(chi.port_bHeaWat,senTHeaWatSup.port_a);
connect(senTHeaWatSup.port_b,conWat.ports[1]);
connect(evaWat.ports[1],senTChiWatSup.port_b);
connect(senTChiWatSup.port_a,chi.port_bChiWat);
connect(conWat.ports[2],senTHeaWatRet.port_a);
connect(senTHeaWatRet.port_b,chi.port_aHeaWat);
connect(chi.port_aChiWat,senTChiWatRet.port_b);
connect(senTChiWatRet.port_a,evaWat.ports[2]);
connect(uCoo.y,chi.uCoo);
connect(uHea.y,chi.uHea);
connect(TChiWatSupSet.y,chi.TChiWatSupSet);
connect(THeaWatRet.y,conWat.T_in);
connect(TChiWatRet.y,evaWat.T_in);
end Chiller;
Validation of the base subsystem model with district heat exchanger
Information
This model validates
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.HeatExchanger
in a configuration where the primary flow rate is modulated by means of a
two-way valve (see hexVal
), and in a configuration where the
primary flow rate is modulated by means of a variable speed pump
(see hexPum
).
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model HeatExchanger
extends Modelica.Icons.Example;
package Medium=
Buildings.Media.Water
;
Fluid.Sources.Boundary_pT bou1(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Fluid.Sources.Boundary_pT bou2(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Modelica.Blocks.Sources.BooleanExpression uHeaRej(
y=time >= 3000)
;
Modelica.Blocks.Sources.BooleanExpression uEnaColRej(
y=time >= 1000
and time < 3000)
;
Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.HeatExchanger
hexPum(
redeclare final package Medium1=Medium,
redeclare final package Medium2=Medium,
show_T=true,
conCon=Buildings.Experimental.DHC.EnergyTransferStations.Types.ConnectionConfiguration.Pump,
dp1Hex_nominal=20E3,
dp2Hex_nominal=20E3,
QHex_flow_nominal=1E6,
T_a1Hex_nominal=281.15,
T_b1Hex_nominal=277.15,
T_a2Hex_nominal=275.15,
T_b2Hex_nominal=279.15,
dT1HexSet=
abs(
hexPum.T_b1Hex_nominal-hexPum.T_a1Hex_nominal) .* {1+1/3,1})
;
Buildings.Controls.OBC.CDL.Logical.Switch swi;
Fluid.Sensors.TemperatureTwoPort senT1OutPum(
redeclare final package Medium=Medium,
m_flow_nominal=hexPum.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT1InlPum(
redeclare final package Medium=Medium,
m_flow_nominal=hexPum.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT2OutPum(
redeclare final package Medium=Medium,
m_flow_nominal=hexPum.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT2InlPum(
redeclare final package Medium=Medium,
m_flow_nominal=hexPum.m1_flow_nominal)
;
Fluid.Sources.Boundary_pT bou2Val(
redeclare package Medium=Medium,
use_T_in=true,
nPorts=2)
;
Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.HeatExchanger
hexVal(
redeclare final package Medium1=Medium,
redeclare final package Medium2=Medium,
show_T=true,
conCon=Buildings.Experimental.DHC.EnergyTransferStations.Types.ConnectionConfiguration.TwoWayValve,
dp1Hex_nominal=20E3,
dp2Hex_nominal=20E3,
QHex_flow_nominal=1E6,
T_a1Hex_nominal=281.15,
T_b1Hex_nominal=277.15,
T_a2Hex_nominal=275.15,
T_b2Hex_nominal=279.15,
dT1HexSet=
abs(
hexVal.T_b1Hex_nominal-hexVal.T_a1Hex_nominal) .* {1+1/3,1})
;
Fluid.Sources.Boundary_pT bou1Val(
redeclare package Medium=Medium,
p=Medium.p_default+30E3,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT bou1Val1(
redeclare package Medium=Medium,
nPorts=1)
;
Fluid.Sensors.TemperatureTwoPort senT1InlVal(
redeclare final package Medium=Medium,
m_flow_nominal=hexVal.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT1OutVal(
redeclare final package Medium=Medium,
m_flow_nominal=hexVal.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT2OutVal(
redeclare final package Medium=Medium,
m_flow_nominal=hexVal.m1_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort senT2InlVal(
redeclare final package Medium=Medium,
m_flow_nominal=hexVal.m1_flow_nominal)
;
Fluid.Sensors.RelativePressure senRelPre(
redeclare final package Medium=Medium);
Buildings.Controls.OBC.CDL.Logical.Or or2;
Modelica.Blocks.Sources.RealExpression yValIsoCon(
y=
if time >= 2500
then
1
else
0)
;
Modelica.Blocks.Sources.RealExpression yValIsoEva(
y=
if time >= 500
then
1
else
0)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sin1(
amplitude=0.5,
freqHz=1e-3,
offset=0.5)
;
Buildings.Controls.OBC.CDL.Logical.Switch swi1;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer(
k=0)
;
Modelica.Blocks.Sources.TimeTable TColVal(
y(
final unit="K",
displayUnit="degC"),
table=[
0,6;
2,6;
3,16;
4.5,16;
5,6;
10,6],
timeScale=1000,
offset=273.15)
;
Modelica.Blocks.Sources.TimeTable THotVal(
y(
final unit="K",
displayUnit="degC"),
table=[
0,45;
2,45;
3,55;
4.5,55;
5,25;
10,25],
timeScale=1000,
offset=273.15)
;
Modelica.Blocks.Sources.TimeTable TDisVal(
y(
final unit="K",
displayUnit="degC"),
table=[
0,8;
1,8;
2,13;
3,18;
4,6;
5,18],
timeScale=1000,
offset=273.15)
;
equation
connect(swi.y,bou2.T_in);
connect(uEnaColRej.y,swi.u2);
connect(hexPum.port_b1,senT1OutPum.port_a);
connect(senT1OutPum.port_b,bou1.ports[1]);
connect(hexPum.port_a1,senT1InlPum.port_b);
connect(senT1InlPum.port_a,bou1.ports[2]);
connect(hexPum.port_b2,senT2OutPum.port_a);
connect(senT2OutPum.port_b,bou2.ports[1]);
connect(bou2.ports[2],senT2InlPum.port_a);
connect(senT2InlPum.port_b,hexPum.port_a2);
connect(swi.y,bou2Val.T_in);
connect(hexVal.port_a1,senT1InlVal.port_b);
connect(senT1InlVal.port_a,bou1Val.ports[1]);
connect(bou1Val1.ports[1],senT1OutVal.port_b);
connect(senT1OutVal.port_a,hexVal.port_b1);
connect(hexVal.port_a2,senT2InlVal.port_b);
connect(senT2InlVal.port_a,bou2Val.ports[1]);
connect(bou2Val.ports[2],senT2OutVal.port_b);
connect(senT2OutVal.port_a,hexVal.port_b2);
connect(hexVal.port_a1,senRelPre.port_a);
connect(senRelPre.port_b,senT1OutVal.port_a);
connect(uEnaColRej.y,or2.u2);
connect(uHeaRej.y,or2.u1);
connect(yValIsoCon.y,hexVal.yValIso_actual[1]);
connect(yValIsoCon.y,hexPum.yValIso_actual[1]);
connect(yValIsoEva.y,hexVal.yValIso_actual[2]);
connect(yValIsoEva.y,hexPum.yValIso_actual[2]);
connect(or2.y,swi1.u2);
connect(sin1.y,swi1.u1);
connect(zer.y,swi1.u3);
connect(swi1.y,hexVal.u);
connect(swi1.y,hexPum.u);
connect(TColVal.y,swi.u1);
connect(THotVal.y,swi.u3);
connect(TDisVal.y,bou1.T_in);
connect(TDisVal.y,bou1Val.T_in);
end HeatExchanger;
Validation of flow switch box
Information
This model validates that
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.SwitchBox
maintains a positive flow rate in the district line outside of the temporization
period set by the controller.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | 1 | Nominal water mass flow rate [kg/s] |
Modelica definition
model SwitchBox
extends Modelica.Icons.Example;
package Medium=
Buildings.Media.Water
;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal=1
;
Fluid.Delays.DelayFirstOrder volSup(
redeclare final package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
final m_flow_nominal=m_flow_nominal,
tau=60,
nPorts=3) ;
Fluid.Delays.DelayFirstOrder volRet(
redeclare final package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
final m_flow_nominal=m_flow_nominal,
tau=60,
nPorts=3) ;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pum1(
redeclare package Medium = Medium,
final m_flow_nominal=m_flow_nominal)
;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pum2(
redeclare package Medium = Medium,
final m_flow_nominal=m_flow_nominal)
;
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Subsystems.SwitchBox
floSwiBox(
final m_flow_nominal=m_flow_nominal,
redeclare final package
Medium = Medium,
trueHoldDuration=300)
;
Fluid.Sensors.MassFlowRate senMasFlo(
redeclare final package Medium = Medium) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant setMasFlo1(k=0.5)
;
Fluid.Sources.Boundary_pT disWatBou(
redeclare package Medium = Medium,
nPorts=2) ;
Modelica.Blocks.Sources.CombiTimeTable setMasFlo2(
tableName="tab1",
table=[0,0; 0.6,1; 0.7,0; 1,1],
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
columns={2},
timeScale=1000) ;
Buildings.Controls.OBC.CDL.Continuous.Gain gai2(
final k=m_flow_nominal)
;
Buildings.Controls.OBC.CDL.Continuous.Gain gai1(
final k=m_flow_nominal)
;
equation
connect(pum1.port_b, volSup.ports[1]);
connect(volSup.ports[2], pum2.port_a);
connect(pum2.port_b, volRet.ports[1]);
connect(volRet.ports[2], pum1.port_a);
connect(floSwiBox.port_bSup, volSup.ports[3]);
connect(floSwiBox.port_aRet, volRet.ports[3]);
connect(floSwiBox.port_bRet, senMasFlo.port_a);
connect(senMasFlo.port_b, disWatBou.ports[1]);
connect(disWatBou.ports[2], floSwiBox.port_aSup);
connect(pum1.m_flow_actual, floSwiBox.mRev_flow);
connect(setMasFlo2.y[1], gai2.u);
connect(gai2.y, pum2.m_flow_in);
connect(setMasFlo1.y, gai1.u);
connect(gai1.y, pum1.m_flow_in);
connect(pum2.m_flow_actual, floSwiBox.mPos_flow);
end SwitchBox;