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.Junction Junction Flow splitter with fixed resistance at each port
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.Junction Buildings.Templates.Components.Routing.Junction

Flow splitter with fixed resistance at each port

Buildings.Templates.Components.Routing.Junction

Information

This is a model of a flow junction with an optional fixed resistance in each flow leg and an optional mixing volume at the junction. This model is identical to Buildings.Fluid.FixedResistances.Junction except for the icon which has been changed for better integration into the templates.

Extends from Buildings.Fluid.FixedResistances.Junction (Flow splitter with fixed resistance at each port).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal[3] Mass flow rate. Set negative at outflowing ports. [kg/s]
Pressuredp_nominal[3] Pressure drop at nominal mass flow rate, set to zero or negative number at outflowing ports. [Pa]
Transition to laminar
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
MassFlowRatemDyn_flow_nominalsum(abs(m_flow_nominal[:])/3)Nominal mass flow rate for dynamic momentum and energy balance [kg/s]
Nominal condition
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances
ExtraPropertyC_nominal[Medium.nC]fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Advanced
Booleanfrom_dptrue= true, use m_flow = f(dp) else dp = f(m_flow)
PortFlowDirectionportFlowDirection_1Modelica.Fluid.Types.PortFlo...Flow direction for port_1
PortFlowDirectionportFlowDirection_2Modelica.Fluid.Types.PortFlo...Flow direction for port_2
PortFlowDirectionportFlowDirection_3Modelica.Fluid.Types.PortFlo...Flow direction for port_3
BooleanverifyFlowReversalfalse=true, to assert that the flow does not reverse when portFlowDirection_* does not equal Bidirectional
MassFlowRatem_flow_smallmDyn_flow_nominal*1e-4Small mass flow rate for checking flow reversal [kg/s]
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Graphics
IconPipeicon_pipe1Buildings.Templates.Componen...Pipe symbol - Branch 1
IconPipeicon_pipe2icon_pipe1Pipe symbol - Branch 2
IconPipeicon_pipe3icon_pipe1Pipe symbol - Branch 3

Connectors

TypeNameDescription
FluidPort_aport_1First port, typically inlet
FluidPort_bport_2Second port, typically outlet
FluidPort_aport_3Third port, can be either inlet or outlet

Modelica definition

model Junction "Flow splitter with fixed resistance at each port" extends Buildings.Fluid.FixedResistances.Junction; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe1 = Buildings.Templates.Components.Types.IconPipe.Supply "Pipe symbol - Branch 1"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe2 = icon_pipe1 "Pipe symbol - Branch 2"; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe3 = icon_pipe1 "Pipe symbol - Branch 3"; end Junction;

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

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"; constant Integer icon_xinl = -100 "Minimum x-coordinate of inlet connection lines"; constant Integer icon_xout = 100 "Maximum x-coordinate of outlet connection lines"; constant Integer icon_offset = 0 "Offset in y-direction between inlet and outlet in icon layer"; constant Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; constant 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

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"; constant Integer icon_offset = 0 "Offset in y-direction between inlet and outlet in icon layer"; constant Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; constant Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.None "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
Graphics
IconPipeicon_pipeBuildings.Templates.Componen...Pipe symbol

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; parameter Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.Supply "Pipe symbol"; 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

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"; constant Integer icon_offset = 0 "Offset in y-direction between inlet and outlet in icon layer"; constant Integer icon_dy = 100 "Distance in y-direction between each branch in icon layer"; constant Buildings.Templates.Components.Types.IconPipe icon_pipe = Buildings.Templates.Components.Types.IconPipe.None "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;