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.Generation5.Examples.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name |
Description |
PartialParallel
|
Partial model for parallel network |
PartialSeries
|
Partial model for series network |
Partial model for parallel network
Information
Partial model with ETS connected in parallel.
Models extending this model must add controls,
and configure some component sizes.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Integer | nBui | datDes.nBui | Number of buildings connected to DHC system |
DesignDataParallel | datDes | datDes(final mCon_flow_nomin... | Design data |
PartialBuildingWithETS | bui[nBui] | redeclare Buildings.Experime... | Building and ETS |
Assumptions |
Boolean | allowFlowReversalSer | true | Set to true to allow flow reversal in the service lines |
Boolean | allowFlowReversalBui | false | Set to true to allow flow reversal for in-building systems |
Modelica definition
partial model PartialParallel
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
constant Real facMul = 10
;
parameter Boolean allowFlowReversalSer = true
;
parameter Boolean allowFlowReversalBui = false
;
parameter Integer nBui = datDes.nBui
;
inner parameter Buildings.Experimental.DHC.Examples.Combined.Generation5.Data.DesignDataParallel
datDes(
final mCon_flow_nominal=bui.ets.mDisWat_flow_nominal) ;
Buildings.Experimental.DHC.Examples.Combined.Generation5.ThermalStorages.BoreField
borFie(
redeclare final package Medium = Medium) ;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumDis(
redeclare final package Medium=Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Buildings.Fluid.Sources.Boundary_pT bou(
redeclare final package Medium=Medium,
nPorts=1)
;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumSto(
redeclare final package Medium=Medium,
final m_flow_nominal=datDes.mSto_flow_nominal,
final allowFlowReversal=allowFlowReversalSer)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.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,
dhDis=0.2,
dhCon=0.2,
final allowFlowReversal=allowFlowReversalSer)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.UnidirectionalParallel
dis(
redeclare final package Medium = Medium,
final nCon=nBui,
final dp_length_nominal=datDes.dp_length_nominal,
final mDis_flow_nominal=datDes.mPipDis_flow_nominal,
final mCon_flow_nominal=datDes.mCon_flow_nominal,
final mDisCon_flow_nominal=datDes.mDisCon_flow_nominal,
final mEnd_flow_nominal=datDes.mEnd_flow_nominal,
final lDis=datDes.lDis,
final lCon=datDes.lCon,
final lEnd=datDes.lEnd,
final allowFlowReversal=allowFlowReversalSer) ;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.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,
dhDis=0.2,
dhCon=0.2,
final allowFlowReversal=allowFlowReversalSer)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.CentralPlants.SewageHeatRecovery
pla(
redeclare 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) ;
Fluid.Sensors.TemperatureTwoPort TDisWatSup(
redeclare final package Medium=Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TDisWatRet(
redeclare final package Medium =Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TDisWatBorLvg(
redeclare final package Medium =Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
replaceable Buildings.Experimental.DHC.Examples.Combined.Generation5.Loads.BaseClasses.PartialBuildingWithETS
bui[nBui]
constrainedby Buildings.Experimental.DHC.Examples.Combined.Generation5.Loads.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) ;
Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMaxSet[nBui](k=bui.THeaWatSup_nominal)
;
Controls.OBC.CDL.Continuous.Sources.Constant TChiWatSupSet[nBui](k=bui.TChiWatSup_nominal)
;
Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17)
;
Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMinSet[nBui](
each k=28
+ 273.15)
;
Buildings.Experimental.DHC.Loads.BaseClasses.ConstraintViolation conVio(
uMin=datDes.TLooMin,
uMax=datDes.TLooMax,
nu=3) ;
Controls.OBC.CDL.Continuous.MultiSum PPumETS(
final nin=nBui)
;
Modelica.Blocks.Continuous.Integrator EPumETS(initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator EPumPla(initType=Modelica.Blocks.Types.Init.InitialState)
;
Controls.OBC.CDL.Continuous.MultiSum EPum(nin=4)
;
Controls.OBC.CDL.Continuous.MultiSum PHeaPump(
final nin=nBui)
;
Modelica.Blocks.Continuous.Integrator EHeaPum(initType=Modelica.Blocks.Types.Init.InitialState)
;
Controls.OBC.CDL.Continuous.MultiSum ETot(nin=2) ;
Modelica.Blocks.Continuous.Integrator EPumDis(initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator EPumSto(initType=Modelica.Blocks.Types.Init.InitialState)
;
initial equation
for i
in 1:nBui
loop
Modelica.Utilities.Streams.print(
"Nominal mass flow rate in section " +
String(i) + ": " +
String(datDes.mDisCon_flow_nominal[i]));
end for;
Modelica.Utilities.Streams.print(
"Nominal mass flow rate in end of line: " +
String(dis.mEnd_flow_nominal));
equation
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_bDisRet, 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(THeaWatSupMaxSet.y, bui.THeaWatSupMaxSet);
connect(TChiWatSupSet.y, bui.TChiWatSupSet);
connect(TSewWat.y, pla.TSewWat);
connect(pla.port_bSerAmb, conPla.port_aCon);
connect(conPla.port_bCon, pla.port_aSerAmb);
connect(THeaWatSupMinSet.y, bui.THeaWatSupMinSet);
connect(TDisWatSup.T, conVio.u[1]);
connect(TDisWatRet.T, conVio.u[2]);
connect(TDisWatBorLvg.T, conVio.u[3]);
connect(bui.PPumETS,PPumETS. u);
connect(PPumETS.y,EPumETS. 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(pumDis.P, EPumDis.u);
connect(pumSto.P, EPumSto.u);
end PartialParallel;
Partial model for series network
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
Type | Name | Default | Description |
Real | dpDis_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m] |
Real | dpCon_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m] |
Integer | nBui | datDes.nBui | Number of buildings connected to DHC system |
DesignDataSeries | datDes | datDes(final mCon_flow_nomin... | Design data |
PartialBuildingWithETS | bui[nBui] | redeclare Buildings.Experime... | Building and ETS |
Assumptions |
Boolean | allowFlowReversalSer | true | Set to true to allow flow reversal in the service lines |
Boolean | allowFlowReversalBui | false | Set to true to allow flow reversal for in-building systems |
Modelica definition
partial model PartialSeries
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
constant Real facMul = 10
;
parameter Real dpDis_length_nominal(
final unit="Pa/m") = 250
;
parameter Real dpCon_length_nominal(
final unit="Pa/m") = 250
;
parameter Boolean allowFlowReversalSer = true
;
parameter Boolean allowFlowReversalBui = false
;
parameter Integer nBui = datDes.nBui
;
inner parameter Buildings.Experimental.DHC.Examples.Combined.Generation5.Data.DesignDataSeries
datDes(
final mCon_flow_nominal=bui.ets.mDisWat_flow_nominal) ;
Buildings.Experimental.DHC.Examples.Combined.Generation5.ThermalStorages.BoreField
borFie(
redeclare final package Medium = Medium) ;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumDis(
redeclare final package Medium = Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal,
final allowFlowReversal=allowFlowReversalSer)
;
Buildings.Fluid.Sources.Boundary_pT bou(
redeclare final package Medium=Medium,
final nPorts=1)
;
DHC.EnergyTransferStations.BaseClasses.Pump_m_flow pumSto(
redeclare final package Medium = Medium,
m_flow_nominal=datDes.mSto_flow_nominal)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.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)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.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)
;
Buildings.Experimental.DHC.Examples.Combined.Generation5.CentralPlants.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) ;
Buildings.Experimental.DHC.Examples.Combined.Generation5.Networks.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) ;
Fluid.Sensors.TemperatureTwoPort TDisWatSup(
redeclare final package Medium = Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TDisWatRet(
redeclare final package Medium = Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TDisWatBorLvg(
redeclare final package Medium = Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
replaceable Buildings.Experimental.DHC.Examples.Combined.Generation5.Loads.BaseClasses.PartialBuildingWithETS
bui[nBui]
constrainedby Buildings.Experimental.DHC.Examples.Combined.Generation5.Loads.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) ;
Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17)
;
Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMaxSet[nBui](
k=bui.THeaWatSup_nominal)
;
Controls.OBC.CDL.Continuous.Sources.Constant TChiWatSupSet[nBui](
k=bui.TChiWatSup_nominal)
;
Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSupMinSet[nBui](
each k=28 + 273.15)
;
Controls.OBC.CDL.Continuous.MultiSum PPumETS(
final nin=nBui)
;
Modelica.Blocks.Continuous.Integrator EPumETS(
initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator EPumDis(
initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator EPumSto(
initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator EPumPla(initType=Modelica.Blocks.Types.Init.InitialState)
;
Controls.OBC.CDL.Continuous.MultiSum EPum(nin=4)
;
Controls.OBC.CDL.Continuous.MultiSum PHeaPump(
final nin=nBui)
;
Modelica.Blocks.Continuous.Integrator EHeaPum(
initType=Modelica.Blocks.Types.Init.InitialState)
;
Controls.OBC.CDL.Continuous.MultiSum ETot(nin=2) ;
Buildings.Experimental.DHC.Loads.BaseClasses.ConstraintViolation conVio(
final uMin=datDes.TLooMin,
final uMax=datDes.TLooMax,
final nu=3+nBui)
;
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;