Buildings.DHC.Networks.Connections.Examples

This package contains example models

Information

This package contains an example illustrating the use of the model in Buildings.DHC.Loads.Combined.

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

Package Content

Name Description
Buildings.DHC.Networks.Connections.Examples.Connection1PipeExample Connection1PipeExample Example model that showcases Connection1Pipe_R and Connection1PipePlugFlow_v models
Buildings.DHC.Networks.Connections.Examples.Connection2PipeExample Connection2PipeExample Example model that showcases Connection2Pipe_R and Connection2PipePlugFlow_v models

Buildings.DHC.Networks.Connections.Examples.Connection1PipeExample Buildings.DHC.Networks.Connections.Examples.Connection1PipeExample

Example model that showcases Connection1Pipe_R and Connection1PipePlugFlow_v models

Buildings.DHC.Networks.Connections.Examples.Connection1PipeExample

Information

Example model of two one-pipe connection models that could be used i.e for building a reservoir network to connect one agent in series. It uses Buildings.DHC.Networks.Connections.Connection1Pipe_R and Buildings.DHC.Networks.Connections.Connection1PipePlugFlow_v. The agent, in this example just a pump, will draw water from the distribution pipe and release it to the same pipe.

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

Parameters

TypeNameDefaultDescription
Lengthdh Hydraulic diameter (assuming a round cross section area) [m]
MassFlowRatemDis_flow_nominal1Nominal mass flow rate in the distribution line [kg/s]
MassFlowRatemCon_flow_nominal0.5Nominal mass flow rate in the connection line [kg/s]
LengthlDis100Length of the distribution pipe before the connection [m]

Modelica definition

model Connection1PipeExample "Example model that showcases Connection1Pipe_R and Connection1PipePlugFlow_v models" extends Modelica.Icons.Example; package MediumW = Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.Length dh( fixed=false, start=0.01, min=0.001) "Hydraulic diameter (assuming a round cross section area)"; parameter Modelica.Units.SI.MassFlowRate mDis_flow_nominal = 1 "Nominal mass flow rate in the distribution line"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal = 0.5 "Nominal mass flow rate in the connection line"; parameter Modelica.Units.SI.Length lDis = 100 "Length of the distribution pipe before the connection"; Buildings.DHC.Networks.Connections.Connection1Pipe_R connection1Pipe_R( redeclare package Medium = MediumW, mDis_flow_nominal=mDis_flow_nominal, mCon_flow_nominal=mCon_flow_nominal, lDis=lDis, dhDis=dh); Buildings.Fluid.Sources.Boundary_pT bouDisAutoSize( redeclare final package Medium = MediumW, p=300000, nPorts=1); Modelica.Blocks.Sources.Constant mDis_flow_nominal_exp(k=mDis_flow_nominal); Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDisPipe_R( dp_nominal=100000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Distribution network pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPipe_R( dp_nominal=5000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Agent connection pump"; Buildings.DHC.Networks.Connections.Connection1PipePlugFlow_v connection1PipeplugFlow( redeclare package Medium = MediumW, mDis_flow_nominal=mDis_flow_nominal, mCon_flow_nominal=mCon_flow_nominal, dIns=0.001, kIns=1, lDis=lDis); Buildings.Fluid.Sources.Boundary_pT bouDisPlugFlow( redeclare final package Medium = MediumW, p=300000, nPorts=1); Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDisPlugFlow( dp_nominal=100000, redeclare final package Medium = MediumW, m_flow_nominal = mDis_flow_nominal) "Distribution network pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPlugFlow( dp_nominal=5000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Agent connection pump"; Fluid.FixedResistances.BuriedPipes.PipeGroundCoupling pipeGroundCoupling( lPip=lDis, rPip=0.04, thiGroLay=1.1, nSta=5, nSeg=1); Modelica.Blocks.Sources.Step mCon_flow_nominal_exp(height=mCon_flow_nominal, startTime=1800); equation connect(pumDisPipe_R.port_b, connection1Pipe_R.port_aDis); connect(bouDisAutoSize.ports[1], connection1Pipe_R.port_aDis); connect(pumDisPipe_R.port_a, connection1Pipe_R.port_bDis); connect(mDis_flow_nominal_exp.y, pumDisPipe_R.m_flow_in); connect(connection1Pipe_R.port_bCon, pumConPipe_R.port_a); connect(pumConPipe_R.port_b, connection1Pipe_R.port_aCon); connect(pumDisPlugFlow.port_b, connection1PipeplugFlow.port_aDis); connect(bouDisPlugFlow.ports[1], connection1PipeplugFlow.port_aDis); connect(pumDisPlugFlow.port_a, connection1PipeplugFlow.port_bDis); connect(mDis_flow_nominal_exp.y, pumDisPlugFlow.m_flow_in); connect(connection1PipeplugFlow.port_bCon, pumConPlugFlow.port_a); connect(pumConPlugFlow.port_b, connection1PipeplugFlow.port_aCon); connect(pipeGroundCoupling.heatPorts[1], connection1PipeplugFlow.heatPortDis); connect(mCon_flow_nominal_exp.y, pumConPipe_R.m_flow_in); connect(pumConPlugFlow.m_flow_in, pumConPipe_R.m_flow_in); end Connection1PipeExample;

Buildings.DHC.Networks.Connections.Examples.Connection2PipeExample Buildings.DHC.Networks.Connections.Examples.Connection2PipeExample

Example model that showcases Connection2Pipe_R and Connection2PipePlugFlow_v models

Buildings.DHC.Networks.Connections.Examples.Connection2PipeExample

Information

Example model of two two-pipe connection models that could be used i.e for building a bi-directional network to connect one agent in series. It uses Buildings.DHC.Networks.Connections.Connection2Pipe_R and Buildings.DHC.Networks.Connections.Connection2PipePlugFlow_v. The agent, in this example just a pump, will draw water from the distribution supply pipe and release it in the return pipe.

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

Parameters

TypeNameDefaultDescription
LengthdhDis Hydraulic diameter (assuming a round cross section area) [m]
LengthdhRet Hydraulic diameter (assuming a round cross section area) [m]
MassFlowRatemDis_flow_nominal1Nominal mass flow rate in the distribution line [kg/s]
MassFlowRatemCon_flow_nominal0.5Nominal mass flow rate in the connection line [kg/s]
LengthlDis100Length of the distribution pipe before the connection [m]

Modelica definition

model Connection2PipeExample "Example model that showcases Connection2Pipe_R and Connection2PipePlugFlow_v models" extends Modelica.Icons.Example; package MediumW = Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.Length dhDis( fixed=false, start=0.01, min=0.001) "Hydraulic diameter (assuming a round cross section area)"; parameter Modelica.Units.SI.Length dhRet( fixed=false, start=0.01, min=0.001) "Hydraulic diameter (assuming a round cross section area)"; parameter Modelica.Units.SI.MassFlowRate mDis_flow_nominal=1 "Nominal mass flow rate in the distribution line"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal=0.5 "Nominal mass flow rate in the connection line"; parameter Modelica.Units.SI.Length lDis=100 "Length of the distribution pipe before the connection"; Buildings.DHC.Networks.Connections.Connection2Pipe_R connection2Pipe_R( redeclare package Medium = MediumW, mDis_flow_nominal=mDis_flow_nominal, mCon_flow_nominal=mCon_flow_nominal, dhDisRet=dhRet, lDis=lDis, dhDis=dhDis); Buildings.Fluid.Sources.Boundary_pT bouDisPipe_R( redeclare final package Medium = MediumW, p=300000, nPorts=1); Modelica.Blocks.Sources.Constant mDis_flow_nominal_exp(k=mDis_flow_nominal); Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDisPipe_R( dp_nominal=100000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Distribution network pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPipe_R( dp_nominal=5000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Agent connection pump"; Buildings.DHC.Networks.Connections.Connection2PipePlugFlow_v connection2PipeplugFlow( redeclare package Medium = MediumW, mDis_flow_nominal=mDis_flow_nominal, mCon_flow_nominal=mCon_flow_nominal, dIns=0.001, kIns=1, lDis=lDis); Buildings.Fluid.Sources.Boundary_pT bouDisPlugFlow( redeclare final package Medium = MediumW, p=300000, nPorts=1); Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDisPlugFlow( dp_nominal=100000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Distribution network pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPlugFlow( dp_nominal=5000, redeclare final package Medium = MediumW, m_flow_nominal=mDis_flow_nominal) "Agent connection pump"; Fluid.FixedResistances.BuriedPipes.PipeGroundCoupling pipeGroundCoupling( lPip=lDis, rPip=0.04, thiGroLay=1.1, nSta=5, nSeg=2); Modelica.Blocks.Sources.Step mCon_flow_nominal_exp(height=mCon_flow_nominal, startTime=1800); Fluid.Sensors.MassFlowRate senMasFloDisAutosize(redeclare final package Medium = MediumW) "Connection supply mass flow rate (measured)"; Fluid.Sensors.MassFlowRate senMasFloDisPlugFlow(redeclare final package Medium = MediumW) "Connection supply mass flow rate (measured)"; equation connect(mDis_flow_nominal_exp.y, pumDisPipe_R.m_flow_in); connect(mDis_flow_nominal_exp.y, pumDisPlugFlow.m_flow_in); connect(connection2PipeplugFlow.port_bCon, pumConPlugFlow.port_a); connect(pumConPlugFlow.port_b,connection2PipeplugFlow. port_aCon); connect(pipeGroundCoupling.heatPorts[1],connection2PipeplugFlow. heatPortDis); connect(mCon_flow_nominal_exp.y, pumConPipe_R.m_flow_in); connect(pumConPlugFlow.m_flow_in, pumConPipe_R.m_flow_in); connect(pumDisPipe_R.port_a, connection2Pipe_R.port_bDisRet); connect(pumDisPlugFlow.port_a,connection2PipeplugFlow. port_bDisRet); connect(connection2PipeplugFlow.heatPortRet, pipeGroundCoupling.heatPorts[2]); connect(pumDisPlugFlow.port_b, connection2PipeplugFlow.port_aDisSup); connect(pumDisPipe_R.port_b, connection2Pipe_R.port_aDisSup); connect(connection2Pipe_R.port_bCon, pumConPipe_R.port_a); connect(pumConPipe_R.port_b, connection2Pipe_R.port_aCon); connect(connection2Pipe_R.port_bDisSup, senMasFloDisAutosize.port_a); connect(senMasFloDisAutosize.port_b, connection2Pipe_R.port_aDisRet); connect(connection2PipeplugFlow.port_bDisSup, senMasFloDisPlugFlow.port_a); connect(senMasFloDisPlugFlow.port_b, connection2PipeplugFlow.port_aDisRet); connect(bouDisPlugFlow.ports[1], connection2PipeplugFlow.port_aDisSup); connect(bouDisPipe_R.ports[1], connection2Pipe_R.port_aDisSup); end Connection2PipeExample;