Buildings.DHC.Plants.Combined.Examples

This package holds example models using plants providing district heating and cooling

Information

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

Package Content

Name Description
Buildings.DHC.Plants.Combined.Examples.AllElectricCWStorage AllElectricCWStorage Validation of all-electric plant model with buildings loads

Buildings.DHC.Plants.Combined.Examples.AllElectricCWStorage Buildings.DHC.Plants.Combined.Examples.AllElectricCWStorage

Validation of all-electric plant model with buildings loads

Buildings.DHC.Plants.Combined.Examples.AllElectricCWStorage

Information

This model uses Buildings.DHC.Plants.Combined.AllElectricCWStorage to provide heating and cooling to two identical buildings with heating and cooling loads provided as time series.

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

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterMain medium (common to CHW, HW and CW)
replaceable package MediumConWatCooBuildings.Media.WaterMedium in cooler circuit
StringfilNam[2]{"modelica://Buildings/Resou...Path to file with timeseries loads
TemperatureTSetDisSupHea273.15 + 60District heating supply temperature set point [K]
TemperatureTSetDisSupCoo273.15 + 6District cooling supply temperature set point [K]
GenericdatHeaPumdatHeaPum(dpHeaLoa_nominal=5...Heat pump parameters (each unit)
CHW loop and cooling-only chillers
ReformEIRChiller_Carrier_19XR_1403kW_7_09COP_VSDdatChidatChi(EIRFunT={0.0101739374...Chiller parameters (each unit)
HW loop and heat recovery chillers
GenericdatChiHeadatChiChiller parameters (each unit)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMain medium (common to CHW, HW and CW)
replaceable package MediumConWatCooMedium in cooler circuit

Modelica definition

model AllElectricCWStorage "Validation of all-electric plant model with buildings loads" extends Modelica.Icons.Example; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Main medium (common to CHW, HW and CW)"; replaceable package MediumConWatCoo=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Medium in cooler circuit"; parameter String filNam[2]={"modelica://Buildings/Resources/Data/DHC/Loads/Examples/MediumOffice-90.1-2010-5A.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/MediumOffice-90.1-2010-5A.mos"} "Path to file with timeseries loads"; parameter Modelica.Units.SI.Temperature TSetDisSupHea = 273.15+60 "District heating supply temperature set point"; parameter Modelica.Units.SI.Temperature TSetDisSupCoo = 273.15+6 "District cooling supply temperature set point"; replaceable parameter Fluid.Chillers.Data.ElectricReformulatedEIR.ReformEIRChiller_Carrier_19XR_1403kW_7_09COP_VSD datChi( EIRFunT={0.0101739374, 0.0607200115, 0.0003348647, 0.003162578, 0.0002388594, -0.0014121289}, capFunT={0.0387084662, 0.2305017927, 0.0004779504, 0.0178244359, -8.48808e-05, -0.0032406711}, EIRFunPLR={0.4304252832, -0.0144718912, 5.12039e-05, -0.7562386674, 0.5661683373, 0.0406987748, 3.0278e-06, -0.3413411197, -0.000469572, 0.0055009208}, QEva_flow_nominal=sum(loaCoo.QCoo_flow_nominal)/pla.nChi, COP_nominal=2.5, mEva_flow_nominal=-datChi.QEva_flow_nominal/5/4186, mCon_flow_nominal=-datChi.QEva_flow_nominal * (1 + 1/datChi.COP_nominal) / 10 / 4186, TEvaLvg_nominal=TSetDisSupCoo, TEvaLvgMin=277.15, TEvaLvgMax=308.15, TConLvg_nominal=TSetDisSupHea, TConLvgMin=296.15, TConLvgMax=336.15) constrainedby Buildings.Fluid.Chillers.Data.BaseClasses.Chiller "Chiller parameters (each unit)"; replaceable parameter Fluid.Chillers.Data.ElectricReformulatedEIR.Generic datChiHea = datChi constrainedby Buildings.Fluid.Chillers.Data.BaseClasses.Chiller "Chiller parameters (each unit)"; replaceable parameter Fluid.HeatPumps.Data.EquationFitReversible.Generic datHeaPum( dpHeaLoa_nominal=50000, dpHeaSou_nominal=100, hea( mLoa_flow=datHeaPum.hea.Q_flow/10/4186, mSou_flow=1E-4*datHeaPum.hea.Q_flow, Q_flow=sum(loaHea.QHea_flow_nominal)/pla.nHeaPum, P=datHeaPum.hea.Q_flow/2.2, coeQ={-5.64420084,1.95212447,9.96663913,0.23316322,-5.64420084}, coeP={-3.96682255,6.8419453,1.99606939,0.01393387,-3.96682255}, TRefLoa=298.15, TRefSou=253.15), coo( mLoa_flow=0, mSou_flow=0, Q_flow=-1, P=0, coeQ=fill(0, 5), coeP=fill(0, 5), TRefLoa=273.15, TRefSou=273.15)) "Heat pump parameters (each unit)"; // Assumptions parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Buildings.DHC.Plants.Combined.AllElectricCWStorage pla( redeclare final package Medium = Medium, redeclare package MediumHea_b = Medium, redeclare final package MediumConWatCoo = MediumConWatCoo, allowFlowReversal=true, dpConWatCooFri_nominal=1E4, mAirCooUni_flow_nominal=pla.mConWatCoo_flow_nominal/pla.nCoo/1.45, TWetBulCooEnt_nominal=297.05, PFanCoo_nominal=340*pla.mConWatCoo_flow_nominal/pla.nCoo, chi(show_T=true), chiHea(show_T=true), heaPum(show_T=true), final datChi=datChi, final datChiHea=datChiHea, final datHeaPum=datHeaPum, nChi=2, dpChiWatSet_max=(sum(disCoo.lDis) + disCoo.lEnd)*disCoo.dp_length_nominal, nChiHea=2, dpHeaWatSet_max=(sum(disHea.lDis) + disHea.lEnd)*disHea.dp_length_nominal, nHeaPum=2, dInsTan=0.05, nCoo=3, final energyDynamics=energyDynamics) "CHW and HW plant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet(final k=pla.TChiWatSup_nominal, y(final unit="K", displayUnit="degC")) "Source signal for setpoint"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupSet(final k=pla.THeaWatSup_nominal, y(final unit="K", displayUnit="degC")) "Source signal for setpoint"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dpHeaWatSet_max( k=pla.dpHeaWatSet_max, y(final unit="Pa")) "Source signal for setpoint"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dpChiWatSet_max( k=pla.dpChiWatSet_max, y(final unit="Pa")) "Source signal for setpoint"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos")) "Outdoor conditions"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatRet[2](each k=pla.TChiWatRet_nominal) "Source signal for CHW return temperature"; Loads.Heating.BuildingTimeSeriesWithETS loaHea[2]( each THeaWatSup_nominal=pla.THeaWatSup_nominal, filNam=filNam) "Building heating load"; // dpCheVal_nominal to avoid too hot water in building waterr supply due to problem of temperature drop in Dymola Loads.Cooling.BuildingTimeSeriesWithETS loaCoo[2]( each TChiWatSup_nominal=pla.TChiWatSup_nominal, filNam=filNam, each bui(w_aLoaCoo_nominal=0.015)) "Building cooling load"; // dpCheVal_nominal to avoid freezing in building waterr supply due to problem of temperature drop in Dymola Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatRet[2](each k=pla.THeaWatRet_nominal) "Source signal for HW return temperature"; Buildings.Controls.OBC.CDL.Logical.Not onPla "On signal for the plant"; Buildings.Controls.OBC.CDL.Logical.Timer tim(t=3600); Buildings.Controls.OBC.CDL.Reals.LessThreshold offHea(t=1e-4) "Threshold comparison to disable the plant"; Modelica.Blocks.Math.Gain norQFloHea(k=1/sum(loaHea.QHea_flow_nominal)) "Normalized Q_flow"; Buildings.Controls.OBC.CDL.Logical.Not onPla1 "On signal for the plant"; Buildings.Controls.OBC.CDL.Logical.Timer tim1(t=3600); Buildings.Controls.OBC.CDL.Reals.LessThreshold offCoo1(t=1e-4) "Threshold comparison to disable the plant"; Modelica.Blocks.Math.Gain norQFloCoo(k=1/sum(loaCoo.QCoo_flow_nominal)) "Normalized Q_flow"; Buildings.DHC.Networks.Distribution2Pipe_R disHea( redeclare final package Medium = Medium, nCon=2, allowFlowReversal=false, mDis_flow_nominal=sum(loaHea.mBui_flow_nominal), mCon_flow_nominal={loaHea[1].mBui_flow_nominal,loaHea[2].mBui_flow_nominal}, mEnd_flow_nominal=sum(loaHea.mBui_flow_nominal), lDis={800,200}, lEnd=200) "Distribution network for district heating system"; Buildings.DHC.Networks.Distribution2Pipe_R disCoo( redeclare final package Medium = Medium, nCon=2, allowFlowReversal=false, mDis_flow_nominal=sum(loaCoo.mBui_flow_nominal), mCon_flow_nominal={loaCoo[1].mBui_flow_nominal,loaCoo[2].mBui_flow_nominal}, mEnd_flow_nominal=sum(loaCoo.mBui_flow_nominal), lDis={80,20}, lEnd=20) "Distribution network for district cooling system"; Modelica.Blocks.Math.Sum QTotHea_flow(nin=2) "Total heating flow rate for all buildings "; Modelica.Blocks.Math.Sum QTotCoo_flow(nin=2) "Total cooling flow rate for all buildings "; equation connect(TChiWatSupSet.y, pla.TChiWatSupSet); connect(THeaWatSupSet.y, pla.THeaWatSupSet); connect(dpChiWatSet_max.y, pla.dpChiWatSet); connect(dpHeaWatSet_max.y, pla.dpHeaWatSet); connect(weaDat.weaBus, pla.weaBus); connect(norQFloHea.y,offHea. u); connect(offHea.y, tim.u); connect(tim.passed, onPla.u); connect(onPla.y, pla.u1Hea); connect(tim1.passed, onPla1.u); connect(offCoo1.y, tim1.u); connect(norQFloCoo.y, offCoo1.u); connect(onPla1.y, pla.u1Coo); connect(pla.port_bSerHea, disHea.port_aDisSup); connect(disHea.port_bDisRet, pla.port_aSerHea); connect(disCoo.port_aDisSup, pla.port_bSerCoo); connect(disCoo.port_bDisRet, pla.port_aSerCoo); connect(disCoo.ports_aCon, loaCoo.port_bSerCoo); connect(disCoo.ports_bCon, loaCoo.port_aSerCoo); connect(disHea.ports_bCon, loaHea.port_aSerHea); connect(loaHea.port_bSerHea, disHea.ports_aCon); connect(QTotHea_flow.y, norQFloHea.u); connect(loaCoo.QCoo_flow, QTotCoo_flow.u); connect(QTotCoo_flow.y, norQFloCoo.u); connect(loaHea.QHea_flow, QTotHea_flow.u); connect(TChiWatRet.y,loaCoo.TDisRetSet); connect(THeaWatRet.y,loaHea.TDisRetSet); end AllElectricCWStorage;