Buildings.Templates.Components.Routing

Connection models for fluid routing

Information

This package contains models that allow connecting component fluid ports together with various routing arrangements.

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

Package Content

Name Description
Buildings.Templates.Components.Routing.MultipleToMultiple MultipleToMultiple Multiple inlet ports, multiple outlet ports
Buildings.Templates.Components.Routing.MultipleToSingle MultipleToSingle Multiple inlet port, single outlet ports
Buildings.Templates.Components.Routing.PassThroughFluid PassThroughFluid Direct fluid pass-through
Buildings.Templates.Components.Routing.SingleToMultiple SingleToMultiple Single inlet port, multiple outlet ports

Buildings.Templates.Components.Routing.MultipleToMultiple Buildings.Templates.Components.Routing.MultipleToMultiple

Multiple inlet ports, multiple outlet ports

Buildings.Templates.Components.Routing.MultipleToMultiple

Information

This is a model of a many-to-many fluid connector with an optional control volume, and an optional mixing port (common leg). It is typically used to connect parallel pumps with parallel chillers or boilers. Selecting a mixing port allows modeling a headered pumping arrangement. Without any mixing port, a dedicated pumping arrangement is modeled.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Configuration
IntegernPorts_a Number of inlet ports
IntegernPorts_bnPorts_aNumber of outlet ports
Booleanhave_comLegfalseSet to true for common leg between inlet and outlet ports (headered connection)
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Dynamics
Nominal condition
Timetau10Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (ports_a -> ports_b)
Advanced
Diagnostics
Booleanshow_TfalseSet to true if actual temperature at port is computed
Graphics
Integericon_extend0Extend lines by this amount in x-direction in icon layer: >0 at outlet, <0 at inlet
Integericon_dy100Distance in y-direction between each branch in icon layer
IconPipeicon_pipeBuildings.Templates.Componen...Pipe symbol

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPorts_aports_a[nPorts_a]Fluid connector a (positive design flow direction is from ports_a to ports_b)
FluidPorts_bports_b[nPorts_b]Fluid connectors b (positive design flow direction is from ports_a to ports_b)
FluidPort_aport_aComLegCommon leg port - Case with common leg

Modelica definition

model MultipleToMultiple "Multiple inlet ports, multiple outlet ports" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Integer nPorts_a "Number of inlet ports"; parameter Integer nPorts_b = nPorts_a "Number of outlet ports"; parameter Boolean have_comLeg = false "Set to true for common leg between inlet and outlet ports (headered connection)"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversal=true "= true to allow flow reversal, false restricts to design direction (ports_a -> ports_b)"; // Diagnostics parameter Boolean show_T = false "Set to true if actual temperature at port is computed"; parameter Integer icon_extend = 0 "Extend lines by this amount in x-direction in icon layer: >0 at outlet, <0 at inlet"; parameter Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.Supply "Pipe symbol"; Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts_a]( redeclare each final package Medium = Medium, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from ports_a to ports_b)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_b[nPorts_b]( redeclare each final package Medium = Medium, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), each h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connectors b (positive design flow direction is from ports_a to ports_b)"; Modelica.Fluid.Interfaces.FluidPort_a port_aComLeg( redeclare final package Medium=Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) if have_comLeg "Common leg port - Case with common leg"; PassThroughFluid pasDed[nPorts_a]( redeclare each final package Medium=Medium) if not have_comLeg "Dedicated fluid pass-through if dedicated arrangement"; Medium.ThermodynamicState sta_a[nPorts_a]= Medium.setState_phX(ports_a.p, noEvent(actualStream(ports_a.h_outflow)), noEvent(actualStream(ports_a.Xi_outflow))) if show_T "Medium properties in ports_a"; Medium.ThermodynamicState sta_b[nPorts_b]= Medium.setState_phX(ports_b.p, noEvent(actualStream(ports_b.h_outflow)), noEvent(actualStream(ports_b.Xi_outflow))) if show_T "Medium properties in ports_b"; Fluid.Delays.DelayFirstOrder del( redeclare final package Medium=Medium, final tau=tau, final m_flow_nominal=m_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nPorts_a+nPorts_b+1) if have_controlVolume and have_comLeg "Fluid volume to break algebraic loop - Case with common leg"; PassThroughFluid pasSteInl(redeclare final package Medium = Medium) if have_comLeg and not have_controlVolume "Fluid pass-through in lieu of control volume - Case with common leg"; PassThroughFluid pasSteOut(redeclare final package Medium = Medium) if have_comLeg and not have_controlVolume "Fluid pass-through in lieu of control volume - Case with common leg"; protected parameter Boolean have_controlVolume= energyDynamics<>Modelica.Fluid.Types.Dynamics.SteadyState "Boolean flag used to remove conditional components"; initial equation if not have_comLeg then assert(nPorts_a==nPorts_b, "In "+ getInstanceName() + ": "+ "In the absence of a common leg (dedicated connection), the number of inlet ports (" + String(nPorts_a) + ") must be equal to the number of outlet ports (" + String(nPorts_b) +")"); end if; equation for i in 1:nPorts_a loop connect(ports_a[i], pasSteInl.port_a); end for; for i in 1:nPorts_b loop connect(pasSteOut.port_b, ports_b[i]); end for; connect(ports_a, pasDed.port_a); connect(pasDed.port_b, ports_b); connect(del.ports[nPorts_a+nPorts_b+1], port_aComLeg); connect(ports_a, del.ports[1:nPorts_a]); connect(del.ports[(nPorts_a+1):(nPorts_a+nPorts_b)], ports_b); connect(pasSteInl.port_b, port_aComLeg); connect(port_aComLeg, pasSteOut.port_a); end MultipleToMultiple;

Buildings.Templates.Components.Routing.MultipleToSingle Buildings.Templates.Components.Routing.MultipleToSingle

Multiple inlet port, single outlet ports

Buildings.Templates.Components.Routing.MultipleToSingle

Information

This is a model of a many-to-one fluid connector with an optional control volume. It is typically used to represent an outlet manifold or multiple junctions converging into a single pipe.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Configuration
IntegernPorts Number of ports
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Dynamics
Nominal condition
Timetau10Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrueSet to true to allow flow reversal, false restricts to design direction (ports_a -> port_b)
Advanced
Diagnostics
Booleanshow_TfalseSet to true if actual temperature at port is computed
Graphics
Integericon_offset0Offset in y-direction between inlet and outlet in icon layer
Integericon_dy100Distance in y-direction between each branch in icon layer
IconPipeicon_pipeBuildings.Templates.Componen...Pipe symbol

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPorts_aports_a[nPorts]Fluid connector a (positive design flow direction is from ports_a to port_b)
FluidPort_bport_bFluid connectors b (positive design flow direction is from ports_a to port_b)

Modelica definition

model MultipleToSingle "Multiple inlet port, single outlet ports" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Integer nPorts "Number of ports"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversal=true "Set to true to allow flow reversal, false restricts to design direction (ports_a -> port_b)"; // Diagnostics parameter Boolean show_T = false "Set to true if actual temperature at port is computed"; parameter Integer icon_offset = 0 "Offset in y-direction between inlet and outlet in icon layer"; parameter Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.Supply "Pipe symbol"; Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts]( redeclare each final package Medium = Medium, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from ports_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_b( redeclare final package Medium = Medium, m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connectors b (positive design flow direction is from ports_a to port_b)"; Fluid.Delays.DelayFirstOrder del( redeclare final package Medium = Medium, final tau=tau, final m_flow_nominal=m_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nPorts+1) if have_controlVolume "Fluid volume to break algebraic loop"; PassThroughFluid pasSte( redeclare final package Medium=Medium) if not have_controlVolume "Fluid pass-through in lieu of control volume"; Medium.ThermodynamicState sta_a[nPorts]= Medium.setState_phX(ports_a.p, noEvent(actualStream(ports_a.h_outflow)), noEvent(actualStream(ports_a.Xi_outflow))) if show_T "Medium properties in ports_a"; Medium.ThermodynamicState sta_b= Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) if show_T "Medium properties in port_b"; protected parameter Boolean have_controlVolume= energyDynamics<>Modelica.Fluid.Types.Dynamics.SteadyState "Boolean flag used to remove conditional components"; equation for i in 1:nPorts loop connect(ports_a[i], pasSte.port_a); end for; connect(ports_a, del.ports[1:nPorts]); connect(del.ports[nPorts+1], port_b); connect(pasSte.port_b, port_b); end MultipleToSingle;

Buildings.Templates.Components.Routing.PassThroughFluid Buildings.Templates.Components.Routing.PassThroughFluid

Direct fluid pass-through

Buildings.Templates.Components.Routing.PassThroughFluid

Information

This is a model of a direct fluid pass-through used for templating purposes.

Extends from Buildings.Fluid.Interfaces.PartialTwoPort (Partial component with two ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model PassThroughFluid "Direct fluid pass-through" extends Buildings.Fluid.Interfaces.PartialTwoPort; equation connect(port_a, port_b); end PassThroughFluid;

Buildings.Templates.Components.Routing.SingleToMultiple Buildings.Templates.Components.Routing.SingleToMultiple

Single inlet port, multiple outlet ports

Buildings.Templates.Components.Routing.SingleToMultiple

Information

This is a model of a one-to-many fluid connector with an optional control volume. It is typically used to represent an inlet manifold or a single pipe diverging into multiple junctions.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Configuration
IntegernPorts Number of ports
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Dynamics
Nominal condition
Timetau10Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrueSet to true to allow flow reversal, false restricts to design direction (port_a -> ports_b)
Advanced
Diagnostics
Booleanshow_TfalseSet to true if actual temperature at port is computed
Graphics
Integericon_offset0Offset in y-direction between inlet and outlet in icon layer
Integericon_dy100Distance in y-direction between each branch in icon layer
IconPipeicon_pipeBuildings.Templates.Componen...Pipe symbol

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to ports_b)
FluidPorts_bports_b[nPorts]Fluid connectors b (positive design flow direction is from port_a to ports_b)

Modelica definition

model SingleToMultiple "Single inlet port, multiple outlet ports" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Integer nPorts "Number of ports"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversal=true "Set to true to allow flow reversal, false restricts to design direction (port_a -> ports_b)"; // Diagnostics parameter Boolean show_T = false "Set to true if actual temperature at port is computed"; parameter Integer icon_offset = 0 "Offset in y-direction between inlet and outlet in icon layer"; parameter Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.Supply "Pipe symbol"; Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare final package Medium = Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from port_a to ports_b)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_b[nPorts]( redeclare each final package Medium = Medium, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), each h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connectors b (positive design flow direction is from port_a to ports_b)"; Fluid.Delays.DelayFirstOrder del( redeclare final package Medium = Medium, final tau=tau, final m_flow_nominal=m_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nPorts+1) if have_controlVolume "Fluid volume to break algebraic loop"; PassThroughFluid pasSte( redeclare final package Medium=Medium) if not have_controlVolume "Fluid pass-through in lieu of control volume"; Medium.ThermodynamicState sta_a= Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) if show_T "Medium properties in port_a"; Medium.ThermodynamicState sta_b[nPorts]= Medium.setState_phX(ports_b.p, noEvent(actualStream(ports_b.h_outflow)), noEvent(actualStream(ports_b.Xi_outflow))) if show_T "Medium properties in ports_b"; protected parameter Boolean have_controlVolume= energyDynamics<>Modelica.Fluid.Types.Dynamics.SteadyState "Boolean flag used to remove conditional components"; equation for i in 1:nPorts loop connect(pasSte.port_b, ports_b[i]); end for; connect(port_a, pasSte.port_a); connect(del.ports[2:nPorts+1], ports_b); connect(del.ports[1], port_a); end SingleToMultiple;