Buildings.Experimental.DHC.Examples.Combined.BaseClasses

Package with base classes that are used by multiple models

Information

This package contains base classes that are used to construct the classes in Buildings.Experimental.DHC.Examples.Combined.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Experimental.DHC.Examples.Combined.BaseClasses.PartialSeries PartialSeries Partial model for series network
Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries DesignDataSeries Record with design data for series network

Buildings.Experimental.DHC.Examples.Combined.BaseClasses.PartialSeries Buildings.Experimental.DHC.Examples.Combined.BaseClasses.PartialSeries

Partial model for series network

Buildings.Experimental.DHC.Examples.Combined.BaseClasses.PartialSeries

Information

Partial model that is used by the reservoir network models. The reservoir network models extend this model, add controls, and configure some component sizes.

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

Parameters

TypeNameDefaultDescription
RealdpDis_length_nominal250Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m]
RealdpCon_length_nominal250Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m]
IntegernBuidatDes.nBuiNumber of buildings connected to DHC system
DesignDataSeriesdatDesdatDes(final mCon_flow_nomin...Design data
PartialBuildingWithETSbui[nBui]redeclare Buildings.Experime...Building and ETS
Assumptions
BooleanallowFlowReversalSertrueSet to true to allow flow reversal in the service lines
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal for in-building systems

Modelica definition

partial model PartialSeries "Partial model for series network" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; constant Real facMul = 10 "Building loads multiplier factor"; parameter Real dpDis_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate - Distribution line"; parameter Real dpCon_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate - Connection line"; parameter Boolean allowFlowReversalSer = true "Set to true to allow flow reversal in the service lines"; parameter Boolean allowFlowReversalBui = false "Set to true to allow flow reversal for in-building systems"; parameter Integer nBui = datDes.nBui "Number of buildings connected to DHC system"; inner parameter Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries datDes(final mCon_flow_nominal=bui.ets.mSerWat_flow_nominal) "Design data"; // COMPONENTS Buildings.Experimental.DHC.Plants.Reservoir.BoreField borFie(redeclare final package Medium = Medium) "Bore field"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumDis( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal, final allowFlowReversal=allowFlowReversalSer, dp_nominal=150E3) "Distribution pump"; Buildings.Fluid.Sources.Boundary_pT bou( redeclare final package Medium=Medium, final nPorts=1) "Boundary pressure condition representing the expansion vessel"; Buildings.Experimental.DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumSto( redeclare final package Medium = Medium, m_flow_nominal=datDes.mSto_flow_nominal) "Bore field pump"; Buildings.Experimental.DHC.Networks.Combined.BaseClasses.ConnectionSeriesStandard conPla( redeclare final package Medium = Medium, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mPla_flow_nominal, lDis=0, lCon=0, final dhDis=0.2, final dhCon=0.2, final allowFlowReversal=allowFlowReversalSer) "Connection to the plant (pressure drop lumped in plant and network model)"; Buildings.Experimental.DHC.Networks.Combined.BaseClasses.ConnectionSeriesStandard conSto( redeclare final package Medium = Medium, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mSto_flow_nominal, lDis=0, lCon=0, final dhDis=0.2, final dhCon=0.2, final allowFlowReversal=allowFlowReversalSer) "Connection to the bore field (pressure drop lumped in plant and network model)"; Buildings.Experimental.DHC.Plants.Heating.SewageHeatRecovery pla( redeclare final package Medium = Medium, final mSew_flow_nominal=datDes.mPla_flow_nominal, final mDis_flow_nominal=datDes.mPla_flow_nominal, final dpSew_nominal=datDes.dpPla_nominal, final dpDis_nominal=datDes.dpPla_nominal, final epsHex=datDes.epsPla) "Sewage heat recovery plant"; Buildings.Experimental.DHC.Networks.Combined.UnidirectionalSeries dis( redeclare final package Medium = Medium, final nCon=nBui, show_TOut=true, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mCon_flow_nominal, final dp_length_nominal=datDes.dp_length_nominal, final lDis=datDes.lDis, final lCon=datDes.lCon, final lEnd=datDes.lEnd, final allowFlowReversal=allowFlowReversalSer) "Distribution network"; Fluid.Sensors.TemperatureTwoPort TDisWatSup( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water supply temperature"; Fluid.Sensors.TemperatureTwoPort TDisWatRet( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water return temperature"; Fluid.Sensors.TemperatureTwoPort TDisWatBorLvg( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water borefield leaving temperature"; replaceable Buildings.Experimental.DHC.Loads.Combined.BaseClasses.PartialBuildingWithETS bui[nBui] constrainedby Buildings.Experimental.DHC.Loads.Combined.BaseClasses.PartialBuildingWithETS ( bui(each final facMul=facMul), redeclare each final package MediumBui = Medium, redeclare each final package MediumSer = Medium, each final allowFlowReversalBui=allowFlowReversalBui, each final allowFlowReversalSer=allowFlowReversalSer) "Building and ETS"; Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17) "Sewage water temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMaxSet[nBui]( k=bui.THeaWatSup_nominal) "Heating water supply temperature set point - Maximum value"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TChiWatSupSet[nBui]( k=bui.TChiWatSup_nominal) "Chilled water supply temperature set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMinSet[nBui]( each k=28 + 273.15) "Heating water supply temperature set point - Minimum value"; Buildings.Controls.OBC.CDL.Continuous.MultiSum PPumETS( final nin=nBui) "ETS pump power"; Modelica.Blocks.Continuous.Integrator EPumETS( initType=Modelica.Blocks.Types.Init.InitialState) "ETS pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumDis( initType=Modelica.Blocks.Types.Init.InitialState) "Distribution pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumSto( initType=Modelica.Blocks.Types.Init.InitialState) "Storage pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumPla(initType=Modelica.Blocks.Types.Init.InitialState) "Plant pump electric energy"; Buildings.Controls.OBC.CDL.Continuous.MultiSum EPum(nin=4) "Total pump electric energy"; Buildings.Controls.OBC.CDL.Continuous.MultiSum PHeaPump( final nin=nBui) "Heat pump power"; Modelica.Blocks.Continuous.Integrator EHeaPum( initType=Modelica.Blocks.Types.Init.InitialState) "Heat pump electric energy"; Buildings.Controls.OBC.CDL.Continuous.MultiSum ETot(nin=2) "Total electric energy"; Buildings.Experimental.DHC.Loads.BaseClasses.ConstraintViolation conVio( final uMin=datDes.TLooMin, final uMax=datDes.TLooMax, final nu=3+nBui) "Check if loop temperatures are within given range"; equation connect(dis.TOut, conVio.u[4:4+nBui-1]); connect(bou.ports[1], pumDis.port_a); connect(borFie.port_b, conSto.port_aCon); connect(pumDis.port_b, conSto.port_aDis); connect(borFie.port_a, pumSto.port_b); connect(conSto.port_bCon, pumSto.port_a); connect(conPla.port_bDis, TDisWatSup.port_a); connect(TDisWatSup.port_b, dis.port_aDisSup); connect(dis.port_bDisSup, TDisWatRet.port_a); connect(TDisWatRet.port_b, pumDis.port_a); connect(conSto.port_bDis, TDisWatBorLvg.port_a); connect(TDisWatBorLvg.port_b, conPla.port_aDis); connect(bui.port_bSerAmb, dis.ports_aCon); connect(dis.ports_bCon, bui.port_aSerAmb); connect(TSewWat.y, pla.TSewWat); connect(THeaWatSupMaxSet.y, bui.THeaWatSupMaxSet); connect(TChiWatSupSet.y, bui.TChiWatSupSet); connect(pla.port_bSerAmb, conPla.port_aCon); connect(conPla.port_bCon, pla.port_aSerAmb); connect(THeaWatSupMinSet.y, bui.THeaWatSupMinSet); connect(bui.PPumETS, PPumETS.u); connect(PPumETS.y, EPumETS.u); connect(pumDis.P, EPumDis.u); connect(pumSto.P, EPumSto.u); connect(pla.PPum, EPumPla.u); connect(EPumETS.y, EPum.u[1]); connect(EPumPla.y, EPum.u[2]); connect(EPumDis.y, EPum.u[3]); connect(EPumSto.y, EPum.u[4]); connect(bui.PHea, PHeaPump.u); connect(PHeaPump.y, EHeaPum.u); connect(EHeaPum.y, ETot.u[1]); connect(EPum.y, ETot.u[2]); connect(TDisWatSup.T, conVio.u[1]); connect(TDisWatBorLvg.T, conVio.u[2]); connect(TDisWatRet.T, conVio.u[3]); end PartialSeries;

Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries

Record with design data for series network

Information

This record contains parameter declarations used in example models of DHC systems.

Extends from Modelica.Icons.Record (Icon for records).

Parameters

TypeNameDefaultDescription
IntegernBui3Number of served buildings
MassFlowRatemPumDis_flow_nominal95Nominal mass flow rate of main distribution pump [kg/s]
MassFlowRatemPipDis_flow_nominalmPumDis_flow_nominalNominal mass flow rate for main pipe sizing [kg/s]
MassFlowRatemCon_flow_nominal[nBui] Nominal mass flow rate in each connection line [kg/s]
MassFlowRatemPla_flow_nominal11.45Plant HX nominal mass flow rate (primary = secondary) [kg/s]
MassFlowRatemSto_flow_nominal105Storage nominal mass flow rate [kg/s]
PressureDifferencedpPla_nominal50000Plant HX pressure drop at nomninal flow rate (primary = secondary) [Pa]
RealepsPla0.935Plant HX effectiveness (constant)
TemperatureTLooMin273.15 + 6Minimum loop temperature [K]
TemperatureTLooMax273.15 + 17Maximum loop temperature [K]
Realdp_length_nominal250Pressure drop per pipe length at nominal flow rate [Pa/m]
LengthlDis[nBui]fill(100, nBui)Length of the distribution pipe before each connection [m]
LengthlCon[nBui]fill(10, nBui)Length of each connection pipe (supply only, not counting return line) [m]
LengthlEndsum(lDis)Length of the end of the distribution line (after last connection) [m]

Modelica definition

record DesignDataSeries "Record with design data for series network" extends Modelica.Icons.Record; parameter Integer nBui = 3 "Number of served buildings"; parameter Modelica.Units.SI.MassFlowRate mPumDis_flow_nominal=95 "Nominal mass flow rate of main distribution pump"; parameter Modelica.Units.SI.MassFlowRate mPipDis_flow_nominal= mPumDis_flow_nominal "Nominal mass flow rate for main pipe sizing"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nBui] "Nominal mass flow rate in each connection line"; parameter Modelica.Units.SI.MassFlowRate mPla_flow_nominal=11.45 "Plant HX nominal mass flow rate (primary = secondary)"; parameter Modelica.Units.SI.MassFlowRate mSto_flow_nominal=105 "Storage nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dpPla_nominal=50000 "Plant HX pressure drop at nomninal flow rate (primary = secondary)"; parameter Real epsPla = 0.935 "Plant HX effectiveness (constant)"; parameter Modelica.Units.SI.Temperature TLooMin=273.15 + 6 "Minimum loop temperature"; parameter Modelica.Units.SI.Temperature TLooMax=273.15 + 17 "Maximum loop temperature"; parameter Real dp_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate"; parameter Modelica.Units.SI.Length lDis[nBui]=fill(100, nBui) "Length of the distribution pipe before each connection"; parameter Modelica.Units.SI.Length lCon[nBui]=fill(10, nBui) "Length of each connection pipe (supply only, not counting return line)"; parameter Modelica.Units.SI.Length lEnd=sum(lDis) "Length of the end of the distribution line (after last connection)"; end DesignDataSeries;