Buildings.DHC.Networks

Package of models for district energy distribution networks

Information

This package contains models for elements that form district energy distribution networks.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.DHC.Networks.Distribution1PipePlugFlow_v Distribution1PipePlugFlow_v Model of a one-pipe distribution network with plug flow pipes in the main line with hydraulic diameter calculated from nominal velocity
Buildings.DHC.Networks.Distribution1Pipe_R Distribution1Pipe_R Model of a one-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length
Buildings.DHC.Networks.Distribution2PipePlugFlow_v Distribution2PipePlugFlow_v Model of a two-pipe distribution network using plug flow pipe models in the main lines with hydraulic diameter calculated from nominal velocity
Buildings.DHC.Networks.Distribution2Pipe_R Distribution2Pipe_R Model of a two-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length
Buildings.DHC.Networks.Connections Connections Package containing various configurations for connecting network participants to a distribution network
Buildings.DHC.Networks.Controls Controls Package of control blocks for distribution systems
Buildings.DHC.Networks.Pipes Pipes Package containing pipe models used within district network modeling
Buildings.DHC.Networks.Steam Steam Collection of models for distribution networks involving steam
Buildings.DHC.Networks.Examples Examples This package contains example models
Buildings.DHC.Networks.BaseClasses BaseClasses Package with base classes that are used by multiple models

Buildings.DHC.Networks.Distribution1PipePlugFlow_v Buildings.DHC.Networks.Distribution1PipePlugFlow_v

Model of a one-pipe distribution network with plug flow pipes in the main line with hydraulic diameter calculated from nominal velocity

Buildings.DHC.Networks.Distribution1PipePlugFlow_v

Information

This model represents a one-pipe distribution network using a connection model with a plug flow pipe model (pressure drop, heat transfer, transport delays) in the main line whose hydraulic diameters are calculated based on nominal velocity at nominal flow rate Buildings.DHC.Networks.Connections.Connection1PipePlugFlow. The same pipe model at the end of the distribution line (after the last connection).

Extends from Buildings.DHC.Networks.BaseClasses.PartialDistribution1Pipe (Partial model for one-pipe distribution network).

Parameters

TypeNameDefaultDescription
IntegernCon Number of connections
replaceable package MediumPartialMediumMedium model
replaceable model Model_pipDisBuildings.Fluid.FixedResista...Model for distribution pipe
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference at each connection
Booleanshow_TOutfalseSet to true to output temperature at connection outlet
LengthlDis[nCon] Length of the distribution pipe before each connection [m]
LengthlEnd Length of the end of the distribution line (after last connection) [m]
LengthdIns0.05Thickness of pipe insulation, used to compute R [m]
ThermalConductivitykIns0.028Heat conductivity of pipe insulation, used to compute R [W/(m.K)]
Velocityv_nominal1.5Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh) [m/s]
Heightroughness2.5e-5Average height of surface asperities (default: smooth steel pipe) [m]
SpecificHeatCapacitycPip2300Specific heat of pipe wall material. 2300 for PE, 500 for steel [J/(kg.K)]
DensityrhoPip930Density of pipe wall material. 930 for PE, 8000 for steel [kg/m3]
Lengththickness0.0035Pipe wall thickness [m]
Nominal condition
MassFlowRatemDis_flow_nominal Nominal mass flow rate in the distribution line [kg/s]
MassFlowRatemCon_flow_nominal[nCon] Nominal mass flow rate in each connection line [kg/s]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau5*60Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
FluidPorts_aports_aCon[nCon]Connection return ports
FluidPorts_bports_bCon[nCon]Connection supply ports
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
replaceable model Model_pipDisModel for distribution pipe
output RealOutputdH_flow[nCon]Difference in enthalpy flow rate between connection supply and return [W]
output RealOutputmCon_flow[nCon]Connection supply mass flow rate (measured) [kg/s]
output RealOutputmByp_flow[nCon]Bypass mass flow rate [kg/s]
output RealOutputTOut[nCon]Temperature in distribution line at each connection outlet [K]
HeatPorts_aheatPorts[nCon + 1]Multiple heat ports that connect to outside of pipe wall

Modelica definition

model Distribution1PipePlugFlow_v "Model of a one-pipe distribution network with plug flow pipes in the main line with hydraulic diameter calculated from nominal velocity" extends Buildings.DHC.Networks.BaseClasses.PartialDistribution1Pipe( tau=5*60, redeclare Buildings.DHC.Networks.Connections.Connection1PipePlugFlow_v con[nCon]( each final dIns=dIns, each final kIns=kIns, each final v_nominal=v_nominal, each final roughness=roughness, each final cPip=cPip, each final rhoPip=rhoPip, each final thickness=thickness, final lDis=lDis), redeclare model Model_pipDis = Buildings.Fluid.FixedResistances.PlugFlowPipe ( final length=lEnd, final dIns=dIns, final kIns=kIns, final v_nominal=v_nominal, final roughness=roughness, final cPip=cPip, final rhoPip=rhoPip, final thickness=thickness)); parameter Modelica.Units.SI.Length lDis[nCon] "Length of the distribution pipe before each connection"; parameter Modelica.Units.SI.Length lEnd "Length of the end of the distribution line (after last connection)"; parameter Modelica.Units.SI.Length dIns=0.05 "Thickness of pipe insulation, used to compute R"; parameter Modelica.Units.SI.ThermalConductivity kIns=0.028 "Heat conductivity of pipe insulation, used to compute R"; parameter Modelica.Units.SI.Velocity v_nominal=1.5 "Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh)"; parameter Modelica.Units.SI.Height roughness=2.5e-5 "Average height of surface asperities (default: smooth steel pipe)"; parameter Modelica.Units.SI.SpecificHeatCapacity cPip=2300 "Specific heat of pipe wall material. 2300 for PE, 500 for steel"; parameter Modelica.Units.SI.Density rhoPip=930 "Density of pipe wall material. 930 for PE, 8000 for steel"; parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"; Modelica.Fluid.Interfaces.HeatPorts_a heatPorts[nCon + 1] "Multiple heat ports that connect to outside of pipe wall"; equation connect(con.heatPortDis, heatPorts[1:nCon]); connect(pipEnd.heatPort, heatPorts[nCon + 1]); end Distribution1PipePlugFlow_v;

Buildings.DHC.Networks.Distribution1Pipe_R Buildings.DHC.Networks.Distribution1Pipe_R

Model of a one-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length

Buildings.DHC.Networks.Distribution1Pipe_R

Information

This is a model of a one-pipe distribution network using a connection model with pipes in the main line whose hydraulic diameters are calculated at initialization based on the pressure drop per pipe length at nominal flow rate Buildings.DHC.Networks.Connections.Connection1Pipe_R. The same pipe model is also used at the end of the distribution line (after the last connection) only on the supply side.

Modeling considerations

Note that dhDis needs to be vectorized, even if the same value is computed for each array element in case of a one-pipe network. This is because the pipe diameter is computed at initialization by the model Buildings.DHC.Networks.Pipes.PipeAutosize which is instantiated for each connection. So the initialization system of equations would be overdetermined if using a parameter binding with a scalar variable.

Extends from Buildings.DHC.Networks.BaseClasses.PartialDistribution1Pipe (Partial model for one-pipe distribution network).

Parameters

TypeNameDefaultDescription
IntegernCon Number of connections
replaceable package MediumPartialMediumMedium model
replaceable model Model_pipDisBuildings.DHC.Networks.Pipes...Model for distribution pipe
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference at each connection
Booleanshow_TOutfalseSet to true to output temperature at connection outlet
Realdp_length_nominal250Pressure drop per pipe length at nominal flow rate [Pa/m]
LengthlDis[nCon] Length of the distribution pipe before each connection [m]
LengthlEnd Length of the end of the distribution line (after last connection) [m]
Nominal condition
MassFlowRatemDis_flow_nominal Nominal mass flow rate in the distribution line [kg/s]
MassFlowRatemCon_flow_nominal[nCon] Nominal mass flow rate in each connection line [kg/s]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau5*60Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
FluidPorts_aports_aCon[nCon]Connection return ports
FluidPorts_bports_bCon[nCon]Connection supply ports
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
replaceable model Model_pipDisModel for distribution pipe
output RealOutputdH_flow[nCon]Difference in enthalpy flow rate between connection supply and return [W]
output RealOutputmCon_flow[nCon]Connection supply mass flow rate (measured) [kg/s]
output RealOutputmByp_flow[nCon]Bypass mass flow rate [kg/s]
output RealOutputTOut[nCon]Temperature in distribution line at each connection outlet [K]

Modelica definition

model Distribution1Pipe_R "Model of a one-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length" extends Buildings.DHC.Networks.BaseClasses.PartialDistribution1Pipe( tau=5*60, redeclare Buildings.DHC.Networks.Connections.Connection1Pipe_R con[nCon]( each final dp_length_nominal=dp_length_nominal, final lDis=lDis, final dhDis=dhDis), redeclare model Model_pipDis = Buildings.DHC.Networks.Pipes.PipeAutosize ( final dp_length_nominal=dp_length_nominal, final dh(fixed=true) = dhEnd, final length=lEnd), pipEnd(fac=1)); 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[nCon] "Length of the distribution pipe before each connection"; parameter Modelica.Units.SI.Length lEnd "Length of the end of the distribution line (after last connection)"; final parameter Modelica.Units.SI.Length dhDis[nCon]( each fixed=false, each start=0.05, each min=0.01) "Hydraulic diameter of the distribution pipe before each connection"; final parameter Modelica.Units.SI.Length dhEnd( fixed=false, start=0.05, min=0.01) "Hydraulic diameter of of the end of the distribution line (after last connection)"; end Distribution1Pipe_R;

Buildings.DHC.Networks.Distribution2PipePlugFlow_v Buildings.DHC.Networks.Distribution2PipePlugFlow_v

Model of a two-pipe distribution network using plug flow pipe models in the main lines with hydraulic diameter calculated from nominal velocity

Buildings.DHC.Networks.Distribution2PipePlugFlow_v

Information

This is a model of a two-pipe distribution network using a connection model with a plug flow pipe model (pressure drop, heat transfer, transport delays) in the main lines whose hydraulic diameters are calculated based on nominal velocity at nominal flow rate Buildings.DHC.Networks.Connections.Connection2PipePlugFlow. The same pipe model is also used at the end of the distribution line (after the last connection) only on the supply side.

Extends from Buildings.DHC.Networks.BaseClasses.PartialDistribution2Pipe (Partial model for two-pipe distribution network).

Parameters

TypeNameDefaultDescription
IntegernCon Number of connections
replaceable package MediumPartialMediumMedium model
replaceable model Model_pipDisBuildings.Fluid.FixedResista...Model for distribution pipe
IntegeriConDpSennConIndex of the connection where the pressure drop is measured
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference at each connection
LengthlDis[nCon] Length of the distribution pipe before each connection (supply only, not counting return line) [m]
LengthlEnd Length of the end of the distribution line (supply only, not counting return line) [m]
LengthdIns0.05Thickness of pipe insulation, used to compute R [m]
ThermalConductivitykIns0.028Heat conductivity of pipe insulation, used to compute R [W/(m.K)]
Velocityv_nominal1.5Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh) [m/s]
Heightroughness2.5e-5Average height of surface asperities (default: smooth steel pipe) [m]
SpecificHeatCapacitycPip2300Specific heat of pipe wall material. 2300 for PE, 500 for steel [J/(kg.K)]
DensityrhoPip930Density of pipe wall material. 930 for PE, 8000 for steel [kg/m3]
Lengththickness0.0035Pipe wall thickness [m]
Nominal condition
MassFlowRatemDis_flow_nominal Nominal mass flow rate in the distribution line before the first connection [kg/s]
MassFlowRatemCon_flow_nominal[nCon] Nominal mass flow rate in each connection line [kg/s]
MassFlowRatemEnd_flow_nominalmDis_flow_nominal - sum(mCon...Nominal mass flow rate in the end of the distribution line [kg/s]
MassFlowRatemDisCon_flow_nominal[nCon]cat(1, {mDis_flow_nominal}, ...Nominal mass flow rate in the distribution line before each connection [kg/s]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
FluidPorts_aports_aCon[nCon]Connection return ports
FluidPorts_bports_bCon[nCon]Connection supply ports
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
replaceable model Model_pipDisModel for distribution pipe
FluidPort_bport_bDisRetDistribution return outlet port
FluidPort_aport_aDisRetDistribution return inlet port
output RealOutputdpPressure difference at given location (measured) [Pa]
output RealOutputdH_flow[nCon]Difference in enthalpy flow rate between connection supply and return [W]
output RealOutputmCon_flow[nCon]Connection supply mass flow rate (measured) [kg/s]
HeatPorts_aheatPortsDis[nCon + 1]Multiple heat ports that connect to outside of pipe wall for distribution pipe
HeatPorts_aheatPortsRet[nCon]Multiple heat ports that connect to outside of pipe wall for return pipe

Modelica definition

model Distribution2PipePlugFlow_v "Model of a two-pipe distribution network using plug flow pipe models in the main lines with hydraulic diameter calculated from nominal velocity" extends Buildings.DHC.Networks.BaseClasses.PartialDistribution2Pipe( redeclare Connections.Connection2PipePlugFlow_v con[nCon]( final lDis=lDis, each final dIns=dIns, each final kIns=kIns, each final v_nominal=v_nominal, each final roughness=roughness, each final cPip=cPip, each final rhoPip=rhoPip, each final thickness=thickness), redeclare model Model_pipDis = Buildings.Fluid.FixedResistances.PlugFlowPipe ( final length=lEnd, final dIns=dIns, final kIns=kIns, final v_nominal=v_nominal, final roughness=roughness, final cPip=cPip, final rhoPip=rhoPip, final thickness=thickness)); parameter Modelica.Units.SI.Length lDis[nCon] "Length of the distribution pipe before each connection (supply only, not counting return line)"; parameter Modelica.Units.SI.Length lEnd "Length of the end of the distribution line (supply only, not counting return line)"; parameter Modelica.Units.SI.Length dIns=0.05 "Thickness of pipe insulation, used to compute R"; parameter Modelica.Units.SI.ThermalConductivity kIns=0.028 "Heat conductivity of pipe insulation, used to compute R"; parameter Modelica.Units.SI.Velocity v_nominal=1.5 "Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh)"; parameter Modelica.Units.SI.Height roughness=2.5e-5 "Average height of surface asperities (default: smooth steel pipe)"; parameter Modelica.Units.SI.SpecificHeatCapacity cPip=2300 "Specific heat of pipe wall material. 2300 for PE, 500 for steel"; parameter Modelica.Units.SI.Density rhoPip=930 "Density of pipe wall material. 930 for PE, 8000 for steel"; parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"; Modelica.Fluid.Interfaces.HeatPorts_a heatPortsDis[nCon + 1] "Multiple heat ports that connect to outside of pipe wall for distribution pipe"; Modelica.Fluid.Interfaces.HeatPorts_a heatPortsRet[nCon] "Multiple heat ports that connect to outside of pipe wall for return pipe"; equation connect(con.heatPortRet, heatPortsRet); connect(con.heatPortDis, heatPortsDis[1:nCon]); connect(pipEnd.heatPort, heatPortsDis[nCon + 1]); end Distribution2PipePlugFlow_v;

Buildings.DHC.Networks.Distribution2Pipe_R Buildings.DHC.Networks.Distribution2Pipe_R

Model of a two-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length

Buildings.DHC.Networks.Distribution2Pipe_R

Information

This is a model of a two-pipe distribution network using a connection model with pipes in the main lines whose hydraulic diameters are calculated at initialization based on the pressure drop per pipe length at nominal flow rate Buildings.DHC.Networks.Connections.Connection2Pipe_R. The same pipe model is also used at the end of the distribution line (after the last connection) only on the supply side.

Modeling considerations

Note that dhDis needs to be vectorized, even if the same value is computed for each array element in case of a one-pipe network. This is because the pipe diameter is computed at initialization by the model Buildings.DHC.Networks.Pipes.PipeAutosize which is instantiated for each connection. So the initialization system of equations would be overdetermined if using a parameter binding with a scalar variable.

Extends from Buildings.DHC.Networks.BaseClasses.PartialDistribution2Pipe (Partial model for two-pipe distribution network).

Parameters

TypeNameDefaultDescription
IntegernCon Number of connections
replaceable package MediumPartialMediumMedium model
replaceable model Model_pipDisBuildings.DHC.Networks.Pipes...Model for distribution pipe
IntegeriConDpSennConIndex of the connection where the pressure drop is measured
Booleanshow_entFlofalseSet to true to output enthalpy flow rate difference at each connection
Realdp_length_nominal250Pressure drop per pipe length at nominal flow rate [Pa/m]
LengthlDis[nCon] Length of the distribution pipe before each connection (supply only, not counting return line) [m]
LengthlEnd Length of the end of the distribution line (supply only, not counting return line) [m]
Nominal condition
MassFlowRatemDis_flow_nominal Nominal mass flow rate in the distribution line before the first connection [kg/s]
MassFlowRatemCon_flow_nominal[nCon] Nominal mass flow rate in each connection line [kg/s]
MassFlowRatemEnd_flow_nominalmDis_flow_nominal - sum(mCon...Nominal mass flow rate in the end of the distribution line [kg/s]
MassFlowRatemDisCon_flow_nominal[nCon]cat(1, {mDis_flow_nominal}, ...Nominal mass flow rate in the distribution line before each connection [kg/s]
Assumptions
BooleanallowFlowReversalfalse= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau5*60Time constant at nominal flow for dynamic energy and momentum balance [s]

Connectors

TypeNameDescription
FluidPorts_aports_aCon[nCon]Connection return ports
FluidPorts_bports_bCon[nCon]Connection supply ports
FluidPort_aport_aDisSupDistribution supply inlet port
FluidPort_bport_bDisSupDistribution supply outlet port
replaceable model Model_pipDisModel for distribution pipe
FluidPort_bport_bDisRetDistribution return outlet port
FluidPort_aport_aDisRetDistribution return inlet port
output RealOutputdpPressure difference at given location (measured) [Pa]
output RealOutputdH_flow[nCon]Difference in enthalpy flow rate between connection supply and return [W]
output RealOutputmCon_flow[nCon]Connection supply mass flow rate (measured) [kg/s]

Modelica definition

model Distribution2Pipe_R "Model of a two-pipe distribution network with hydraulic diameter of main line pipes calculated from pressure drop per length" extends Buildings.DHC.Networks.BaseClasses.PartialDistribution2Pipe( tau=5*60, redeclare Buildings.DHC.Networks.Connections.Connection2Pipe_R con[nCon]( each final dp_length_nominal=dp_length_nominal, final lDis=lDis, final dhDis=dhDis, final dhDisRet=dhDisRet), redeclare model Model_pipDis = Buildings.DHC.Networks.Pipes.PipeAutosize ( roughness=7e-6, fac=1.5, final dp_length_nominal=dp_length_nominal, final dh(fixed=true) = dhEnd, final length=lEnd), pipEnd(fac=1)); 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[nCon] "Length of the distribution pipe before each connection (supply only, not counting return line)"; parameter Modelica.Units.SI.Length lEnd "Length of the end of the distribution line (supply only, not counting return line)"; final parameter Modelica.Units.SI.Length dhDis[nCon]( each fixed=false, each start=0.05, each min=0.01) "Hydraulic diameter of the distribution pipe before each connection"; final parameter Modelica.Units.SI.Length dhDisRet[nCon]( each fixed=false, each start=0.05, each min=0.01) "Hydraulic diameter of the distribution pipe before each connection"; final parameter Modelica.Units.SI.Length dhEnd( fixed=false, start=0.05, min=0.01) "Hydraulic diameter of the end of the distribution line"; end Distribution2Pipe_R;