Buildings.DHC.Plants.Combined.Subsystems.BaseClasses

Package with base classes

Information

This package contains base classes that are used to construct subsystem models.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.MultipleValves MultipleValves Parallel arrangement of identical two-way modulating valves
Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PartialMultiplePumps PartialMultiplePumps Base class for modeling multiple identical pumps in parallel
Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PassThroughFluid PassThroughFluid Direct fluid pass-through

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.MultipleValves Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.MultipleValves

Parallel arrangement of identical two-way modulating valves

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.MultipleValves

Information

This model represents a set of control valves piped in parallel. An optional fixed resistance may be included in series with each valve.

Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernUni Number of units (branches in the network)
TwoWayEqualPercentageval[nUni]redeclare Fluid.Actuators.Va...Modulating valve
Nominal condition
MassFlowRatemUni_flow_nominal Nominal mass flow rate (each unit) [kg/s]
PressureDifferencedpValve_nominal Nominal pressure drop of fully open valve (each unit) [Pa]
PressureDifferencedpFixed_nominal0Pressure drop of pipe and other resistances that are in series (each unit) [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
RealmSenFac1Factor for scaling the sensible thermal mass of the volume
Filtered opening
Booleanuse_inputFiltertrueOpening is filtered with a 2nd order CriticalDamping filter
TimeriseTime120Rise time of the filter (time to reach 99.6 % of an opening step) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial position of actuator
Advanced
Dynamics
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
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.)
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)
input RealInputy[nUni]Valve commanded position
output RealOutputy_actual[nUni]Valve returned position

Modelica definition

model MultipleValves "Parallel arrangement of identical two-way modulating valves" extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations( final massDynamics=energyDynamics, final mSenFac=1); extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal(final min=Modelica.Constants.small)=nUni*mUni_flow_nominal, show_T=false, port_a( h_outflow(start=h_outflow_start)), port_b( h_outflow(start=h_outflow_start), p(start=p_start), final m_flow(max = if allowFlowReversal then +Modelica.Constants.inf else 0))); parameter Integer nUni( final min=1, start=1) "Number of units (branches in the network)"; parameter Modelica.Units.SI.MassFlowRate mUni_flow_nominal( final min=Modelica.Constants.small) "Nominal mass flow rate (each unit)"; parameter Modelica.Units.SI.PressureDifference dpValve_nominal( displayUnit="Pa", min=0) "Nominal pressure drop of fully open valve (each unit)"; parameter Modelica.Units.SI.PressureDifference dpFixed_nominal( displayUnit="Pa", min=0) = 0 "Pressure drop of pipe and other resistances that are in series (each unit)"; parameter Boolean use_inputFilter=true "Opening is filtered with a 2nd order CriticalDamping filter"; parameter Modelica.Units.SI.Time riseTime=120 "Rise time of the filter (time to reach 99.6 % of an opening step)"; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; parameter Real y_start=1 "Initial position of actuator"; parameter Boolean from_dp = false "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Boolean linearized = false "= true, use linear relation between m_flow and dp for any flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput y[nUni] "Valve commanded position"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual[nUni] "Valve returned position"; Fluid.FixedResistances.Junction junInl[nUni]( redeclare each final package Medium=Medium, each final m_flow_nominal=m_flow_nominal * {1,-1,-1}, each final dp_nominal=fill(0,3), each final energyDynamics=energyDynamics, each final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, each final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, each final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving) "Fluid junction"; Fluid.FixedResistances.Junction junOut[nUni]( redeclare each final package Medium=Medium, each final m_flow_nominal=m_flow_nominal * {1,-1,1}, each final dp_nominal=fill(0,3), each final energyDynamics=energyDynamics, each final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, each final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, each final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering) "Fluid junction"; replaceable Fluid.Actuators.Valves.TwoWayEqualPercentage val[nUni] constrainedby Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValveKv( redeclare each final package Medium = Medium, each final from_dp=from_dp, each final linearized=linearized, each final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, each final m_flow_nominal=mUni_flow_nominal, each final dpValve_nominal=dpValve_nominal, each final dpFixed_nominal=dpFixed_nominal, each final allowFlowReversal=allowFlowReversal, each final use_inputFilter=use_inputFilter, each final riseTime=riseTime, each final init=init, each final y_start=y_start) "Modulating valve"; protected final parameter Medium.ThermodynamicState sta_start=Medium.setState_pTX( T=T_start, p=p_start, X=X_start) "Medium state at start values"; final parameter Modelica.Units.SI.SpecificEnthalpy h_outflow_start= Medium.specificEnthalpy(sta_start) "Start value for outflowing enthalpy"; equation if nUni > 1 then for i in 1:(nUni - 1) loop connect(junOut[i].port_1, junOut[i+1].port_2); connect(junInl[i].port_2, junInl[i+1].port_1); end for; end if; connect(junInl.port_3, val.port_a); connect(val.port_b, junOut.port_3); connect(junOut[1].port_2, port_b); connect(port_a, junInl[1].port_1); connect(val.y_actual, y_actual); connect(y, val.y); end MultipleValves;

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PartialMultiplePumps Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PartialMultiplePumps

Base class for modeling multiple identical pumps in parallel

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PartialMultiplePumps

Information

This base class represents multiple identical pumps that are piped in parallel. An optional check valve in series with each pump is included. This class is used to construct the various multiple-pump models within Buildings.DHC.Plants.Combined.Subsystems.

Details

In a parallel arrangement, all operating units have the same operating point. This allows modeling the multiple pumps with a single instance of any class derived from Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine. Hydronics are resolved with mass flow rate multiplier components.

Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPum Number of pumps
Booleanhave_vartrueSet to true for variable speed pumps, false for constant speed
Booleanhave_valvetrueSet to true for inline check valve
Genericperredeclare parameter Fluid.Mo...Pump parameters
SpeedControlled_ypumredeclare Fluid.Movers.Speed...Pump
Nominal condition
MassFlowRatemPum_flow_nominal Design mass flow rate (each pump) [kg/s]
PressureDifferencedpPum_nominal Design head (each pump) [Pa]
PressureDifferencedpValve_nominal10000Pressure drop of check valve fully open [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
RealmSenFac1Factor for scaling the sensible thermal mass of the volume
Nominal condition
Timetau1Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s]
Filtered speed
Booleanuse_inputFiltertrue= true, if speed is filtered with a 2nd order CriticalDamping filter
TimeriseTime30Rise time of the filter (time to reach 99.6 % of the speed) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Advanced
Dynamics
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
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.)
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)
input BooleanInputy1[nPum]Start signal (VFD Run or motor starter contact)
output RealOutputPTotal power (all pumps) [W]
output BooleanOutputy1_actual[nPum]Pump status

Modelica definition

partial model PartialMultiplePumps "Base class for modeling multiple identical pumps in parallel" extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations( final massDynamics=energyDynamics, final mSenFac=1); extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal(final min=Modelica.Constants.small)=nPum * mPum_flow_nominal, show_T=false, port_a( h_outflow(start=h_outflow_start)), port_b( h_outflow(start=h_outflow_start), p(start=p_start), final m_flow(max = if allowFlowReversal then +Modelica.Constants.inf else 0))); parameter Integer nPum( final min=1, start=1) "Number of pumps"; parameter Boolean have_var = true "Set to true for variable speed pumps, false for constant speed"; parameter Boolean have_valve = true "Set to true for inline check valve"; parameter Modelica.Units.SI.MassFlowRate mPum_flow_nominal "Design mass flow rate (each pump)"; parameter Modelica.Units.SI.PressureDifference dpPum_nominal( displayUnit="Pa") "Design head (each pump)"; parameter Modelica.Units.SI.PressureDifference dpValve_nominal( displayUnit="Pa")=10000 "Pressure drop of check valve fully open"; replaceable parameter Fluid.Movers.Data.Generic per constrainedby Buildings.Fluid.Movers.Data.Generic( pressure( V_flow={0, 1, 2} * mPum_flow_nominal / rho_default, dp={1.14, 1, 0.42} * dpPum_nominal), motorCooledByFluid=false) "Pump parameters"; parameter Modelica.Units.SI.Time tau=1 "Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic"; // Classes used to implement the filtered speed parameter Boolean use_inputFilter=true "= true, if speed is filtered with a 2nd order CriticalDamping filter"; parameter Modelica.Units.SI.Time riseTime=30 "Rise time of the filter (time to reach 99.6 % of the speed)"; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1[nPum] "Start signal (VFD Run or motor starter contact)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput P(final unit="W") "Total power (all pumps)"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1_actual[nPum] "Pump status"; Fluid.BaseClasses.MassFlowRateMultiplier mulOut( redeclare final package Medium=Medium, final use_input=true) "Flow rate multiplier"; Fluid.BaseClasses.MassFlowRateMultiplier mulInl( redeclare final package Medium=Medium, final use_input=true) "Flow rate multiplier"; replaceable Fluid.Movers.SpeedControlled_y pum constrainedby Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine( redeclare final package Medium=Medium, final tau=tau, final show_T=show_T, final allowFlowReversal=allowFlowReversal, final energyDynamics=energyDynamics, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final per=per, addPowerToMedium=false) "Pump"; Buildings.Templates.Components.Controls.MultipleCommands com(final nUni=nPum) "Convert command signal"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea "Convert to real"; Buildings.Controls.OBC.CDL.Reals.Multiply mul "Compute total power"; Buildings.Controls.OBC.CDL.Reals.Multiply inp "Compute pump input signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant cst if not have_var "Constant setpoint"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold isOpe(t=1E-2, h=0.5E-2) "Evaluate if pump is operating"; Fluid.FixedResistances.CheckValve cheVal( redeclare final package Medium=Medium, final m_flow_nominal=mPum_flow_nominal, final dpValve_nominal=dpValve_nominal, final show_T=show_T, final allowFlowReversal=allowFlowReversal) if have_valve "Check valve (optional)"; Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PassThroughFluid pas( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal) if not have_valve "Direct fluid pass-through (case without check valve)"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator rep( final nout=nPum) "Replicate"; Buildings.Controls.OBC.CDL.Logical.Pre preY1[nPum] "Left limit of signal avoiding direct feedback of status to controller"; protected parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default) "State of the medium at the medium default properties"; parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default) "Density at the medium default properties"; final parameter Medium.ThermodynamicState sta_start=Medium.setState_pTX( T=T_start, p=p_start, X=X_start) "Medium state at start values"; final parameter Modelica.Units.SI.SpecificEnthalpy h_outflow_start= Medium.specificEnthalpy(sta_start) "Start value for outflowing enthalpy"; equation connect(mulOut.port_b, port_b); connect(port_a, mulInl.port_a); connect(mulOut.uInv, mulInl.u); connect(mulInl.port_b, pum.port_a); connect(com.nUniOnBou, mulOut.u); connect(com.y1One, booToRea.u); connect(mul.y, P); connect(com.nUniOn, mul.u1); connect(pum.P, mul.u2); connect(pum.port_b, cheVal.port_a); connect(cheVal.port_b, mulOut.port_a); connect(cst.y, inp.u1); connect(booToRea.y, inp.u2); connect(pum.port_b, pas.port_a); connect(pas.port_b, mulOut.port_a); connect(pum.y_actual, isOpe.u); connect(isOpe.y, rep.u); connect(y1, preY1.u); connect(preY1.y, com.y1); connect(rep.y, y1_actual); end PartialMultiplePumps;

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PassThroughFluid Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.PassThroughFluid

Direct fluid pass-through

Buildings.DHC.Plants.Combined.Subsystems.BaseClasses.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;