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 |
Connection1PipeExample
|
Example model that showcases Connection1Pipe_R and Connection1PipePlugFlow_v models |
Connection2PipeExample
|
Example model that showcases Connection2Pipe_R and Connection2PipePlugFlow_v models |
Example model that showcases Connection1Pipe_R and Connection1PipePlugFlow_v models
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
Type | Name | Default | Description |
Length | dh | | Hydraulic diameter (assuming a round cross section area) [m] |
MassFlowRate | mDis_flow_nominal | 1 | Nominal mass flow rate in the distribution line [kg/s] |
MassFlowRate | mCon_flow_nominal | 0.5 | Nominal mass flow rate in the connection line [kg/s] |
Length | lDis | 100 | Length of the distribution pipe before the connection [m] |
Modelica definition
model Connection1PipeExample
extends Modelica.Icons.Example;
package MediumW =
Buildings.Media.Water ;
parameter Modelica.Units.SI.Length dh(
fixed=false,
start=0.01,
min=0.001) ;
parameter Modelica.Units.SI.MassFlowRate mDis_flow_nominal = 1
;
parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal = 0.5
;
parameter Modelica.Units.SI.Length lDis = 100
;
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) ;
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPipe_R(
dp_nominal=5000,
redeclare final package Medium = MediumW,
m_flow_nominal=mDis_flow_nominal) ;
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) ;
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPlugFlow(
dp_nominal=5000,
redeclare final package Medium = MediumW,
m_flow_nominal=mDis_flow_nominal) ;
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;
Example model that showcases Connection2Pipe_R and Connection2PipePlugFlow_v models
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
Type | Name | Default | Description |
Length | dhDis | | Hydraulic diameter (assuming a round cross section area) [m] |
Length | dhRet | | Hydraulic diameter (assuming a round cross section area) [m] |
MassFlowRate | mDis_flow_nominal | 1 | Nominal mass flow rate in the distribution line [kg/s] |
MassFlowRate | mCon_flow_nominal | 0.5 | Nominal mass flow rate in the connection line [kg/s] |
Length | lDis | 100 | Length of the distribution pipe before the connection [m] |
Modelica definition
model Connection2PipeExample
extends Modelica.Icons.Example;
package MediumW =
Buildings.Media.Water ;
parameter Modelica.Units.SI.Length dhDis(
fixed=false,
start=0.01,
min=0.001) ;
parameter Modelica.Units.SI.Length dhRet(
fixed=false,
start=0.01,
min=0.001) ;
parameter Modelica.Units.SI.MassFlowRate mDis_flow_nominal=1
;
parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal=0.5
;
parameter Modelica.Units.SI.Length lDis=100
;
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) ;
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPipe_R(
dp_nominal=5000,
redeclare final package Medium = MediumW,
m_flow_nominal=mDis_flow_nominal) ;
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) ;
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumConPlugFlow(
dp_nominal=5000,
redeclare final package Medium = MediumW,
m_flow_nominal=mDis_flow_nominal) ;
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) ;
Fluid.Sensors.MassFlowRate senMasFloDisPlugFlow(
redeclare final package
Medium = MediumW) ;
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;