Buildings.Fluid.HydronicConfigurations.Components

Package with component models

Information

This package contains component models that are used to construct the models within Buildings.Fluid.HydronicConfigurations. Those components are "wrapper" or "container" classes that conditionally instantiate models from Buildings.Fluid and enable switching from one model to another by a simple parameter assignment.

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

Package Content

Name Description
Buildings.Fluid.HydronicConfigurations.Components.Pump Pump Container class for circulating pumps
Buildings.Fluid.HydronicConfigurations.Components.ThreeWayValve ThreeWayValve Container class for three-way valves
Buildings.Fluid.HydronicConfigurations.Components.TwoWayValve TwoWayValve Container class for two-way valves

Buildings.Fluid.HydronicConfigurations.Components.Pump Buildings.Fluid.HydronicConfigurations.Components.Pump

Container class for circulating pumps

Buildings.Fluid.HydronicConfigurations.Components.Pump

Information

This is a container class for pump models from Buildings.Fluid.Movers.

Two parameters allow configuring the model.

The model takes the following input variables that are conditional to the parameter typ.

Variable Type (unit) Condition Description
y1 Boolean Only available if typ<>None Start signal
y Real (-) Only available if typ==VariableInput Analog control signal. Whatever the type of pump model (specified with typMod) the container class takes a non-dimensional input between 0 and 1.

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
Genericperredeclare parameter Building...Record with performance data
BooleanaddPowerToMediumtrueSet to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)
Configuration
PumptypBuildings.Fluid.HydronicConf...Type of secondary pump
PumpModeltypModBuildings.Fluid.HydronicConf...Type of pump model
Nominal condition
PressureDifferencedp_nominal Pump head at design conditions [Pa]
Control
InputTypeinputTypeBuildings.Fluid.Types.InputT...Control input type
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 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 RealInputyAnalog control signal [1]
input BooleanInputy1Start signal
output RealOutputy_actualActual pump input value that is used for computations [1]
output RealOutputPElectrical power consumed [W]
HeatPort_aheatPortHeat dissipation to environment

Modelica definition

model Pump "Container class for circulating pumps" extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations( final massDynamics=energyDynamics, final mSenFac=1); extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( m_flow_nominal( final min=Modelica.Constants.small), 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 Buildings.Fluid.HydronicConfigurations.Types.Pump typ= Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput "Type of secondary pump"; parameter Buildings.Fluid.HydronicConfigurations.Types.PumpModel typMod= Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Speed "Type of pump model"; parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa") "Pump head at design conditions"; replaceable parameter Buildings.Fluid.Movers.Data.Generic per constrainedby Buildings.Fluid.Movers.Data.Generic( pressure( V_flow={0, 1, 2} * m_flow_nominal / rho_default, dp={1.14, 1, 0.42} * dp_nominal)) "Record with performance data"; parameter Buildings.Fluid.Types.InputType inputType= Buildings.Fluid.Types.InputType.Continuous "Control input type"; parameter Boolean addPowerToMedium=true "Set to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)"; // 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)"; // Variables Modelica.Units.SI.VolumeFlowRate VMachine_flow = V_flow.V_flow "Volume flow rate"; Modelica.Units.SI.PressureDifference dpMachine(displayUnit="Pa") = port_b.p - port_a.p "Pressure rise"; Buildings.Controls.OBC.CDL.Interfaces.RealInput y( final unit="1") if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput "Analog control signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1 if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Start signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual( final unit="1") if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Actual pump input value that is used for computations"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput P( quantity="Power", final unit="W") if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Electrical power consumed"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Heat dissipation to environment"; Movers.FlowControlled_dp pumDp( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final m_flow_nominal=m_flow_nominal, final m_flow_small=m_flow_small, final show_T=show_T, final inputType=Buildings.Fluid.Types.InputType.Continuous, final addPowerToMedium=addPowerToMedium, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final per=per) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Head "Pump with ideally controlled head as input signal"; Movers.SpeedControlled_y pumSpe( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final m_flow_small=m_flow_small, final show_T=show_T, final inputType=Buildings.Fluid.Types.InputType.Continuous, final addPowerToMedium=addPowerToMedium, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final per=per) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Speed "Pump with ideally controlled normalized speed as input"; Movers.FlowControlled_m_flow pumFlo( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final m_flow_small=m_flow_small, final show_T=show_T, final inputType=Buildings.Fluid.Types.InputType.Continuous, final addPowerToMedium=addPowerToMedium, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final per=per) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None and typMod==Buildings.Fluid.HydronicConfigurations.Types.PumpModel.MassFlowRate "Pump with ideally controlled mass flow rate as input"; Sensors.VolumeFlowRate V_flow( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal) "Volume flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaHea( final k=dp_nominal) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Scale control input to design head"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaSpe( final k=per.speed_nominal) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Scale control input to design speed"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter scaFlo( final k=m_flow_nominal) if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Scale control input to design flow rate"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(final k=0.0) "Zero"; Buildings.Controls.OBC.CDL.Reals.Switch swi if typ<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Switch on/off"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant One(final k=1.0) if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.NoVariableInput "one"; FixedResistances.LosslessPipe noPum( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal) if typ==Buildings.Fluid.HydronicConfigurations.Types.Pump.None "Direct fluid pass-through in case of no pump"; protected final parameter Modelica.Units.SI.Density rho_default=Medium.density_pTX( p=Medium.p_default, T=Medium.T_default, X=Medium.X_default) "Default medium density"; 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(pumDp.port_b, port_b); connect(pumSpe.port_b, port_b); connect(pumDp.heatPort, heatPort); connect(pumSpe.heatPort, heatPort); connect(pumFlo.heatPort, heatPort); connect(pumFlo.port_b, port_b); connect(pumDp.P, P); connect(pumDp.y_actual, y_actual); connect(pumSpe.P, P); connect(pumSpe.y_actual, y_actual); connect(pumFlo.P, P); connect(pumFlo.y_actual, y_actual); connect(port_a, V_flow.port_a); connect(V_flow.port_b, pumSpe.port_a); connect(V_flow.port_b, pumDp.port_a); connect(V_flow.port_b, pumFlo.port_a); connect(scaHea.y, pumDp.dp_in); connect(scaSpe.y, pumSpe.y); connect(scaFlo.y, pumFlo.m_flow_in); connect(zer.y, swi.u3); connect(y, swi.u1); connect(y1, swi.u2); connect(swi.y, scaHea.u); connect(swi.y, scaSpe.u); connect(swi.y, scaFlo.u); connect(One.y, swi.u1); connect(V_flow.port_b, noPum.port_a); connect(noPum.port_b, port_b); end Pump;

Buildings.Fluid.HydronicConfigurations.Components.ThreeWayValve Buildings.Fluid.HydronicConfigurations.Components.ThreeWayValve

Container class for three-way valves

Buildings.Fluid.HydronicConfigurations.Components.ThreeWayValve

Information

This is a container class for three-way valve models from Buildings.Fluid.Actuators.Valves.

The parameter typCha allows configuring the model by selecting the valve characteristic to be used based on the enumeration Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.

The default setting for the ratio of the Kvs coefficient between the bypass branch and the direct branch is fraK=1.0, see Buildings.Fluid.HydronicConfigurations.UsersGuide.ControlValves for the justification.

Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Actuators.BaseClasses.ValveParameters (Model with parameters for valves).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
GenericflowCharacteristics1flowCharacteristics1(y={0,1}...Table with flow characteristics for direct flow path at port_1
GenericflowCharacteristics3flowCharacteristics3(y={0,1}...Table with flow characteristics for bypass flow path at port_3
RealR50Rangeability, R=50...100 typically
Realdelta00.01Range of significant deviation from equal percentage law
RealfraK1.0Fraction Kv(port_3&rarr;port_2)/Kv(port_1&rarr;port_2)
Reall[2]{0.0001,0.0001}Valve leakage, l=Kv(y=0)/Kv(y=1)
Flow Coefficient
CvTypesCvDataBuildings.Fluid.Types.CvType...Selection of flow coefficient
RealKv Kv (metric) flow coefficient [m3/h/(bar)^(1/2)]
RealCv Cv (US) flow coefficient [USG/min/(psi)^(1/2)]
AreaAv Av (metric) flow coefficient [m2]
Pressure-flow linearization
RealdeltaM0.02Fraction of nominal flow rate where linearization starts, if y=1
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedpValve_nominal Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint [Pa]
PressureDifferencedpFixed_nominal[2]{0,0}Nominal pressure drop of pipes and other equipment in flow legs at port_1 and port_3 [Pa]
Configuration
ValveCharacteristictypChaBuildings.Fluid.HydronicConf...Valve characteristic
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
Timetau10Time constant at nominal flow for dynamic energy and momentum balance [s]
Filtered opening
Booleanuse_inputFiltertrue= true, if opening 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
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Booleanlinearized[2]{false,false}= true, use linear relation between m_flow and dp for any flow rate
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
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.)

Connectors

TypeNameDescription
FluidPort_aport_1First port, typically inlet
FluidPort_bport_2Second port, typically outlet
FluidPort_aport_3Third port, can be either inlet or outlet
input RealInputyInput control signal [1]
output RealOutputy_actualActual actuator position

Modelica definition

model ThreeWayValve "Container class for three-way valves" extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations( final massDynamics=energyDynamics, final mSenFac=1); extends Buildings.Fluid.Actuators.BaseClasses.ValveParameters( rhoStd=Medium.density_pTX(101325, 273.15+4, Medium.X_default)); parameter Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic typCha=Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage "Valve characteristic"; parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics1( y={0,1}, phi={0.0001,1}) "Table with flow characteristics for direct flow path at port_1"; parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics3( y={0,1}, phi={0.0001,1}) "Table with flow characteristics for bypass flow path at port_3"; parameter Modelica.Units.SI.PressureDifference dpFixed_nominal[2]( each displayUnit="Pa")={0,0} "Nominal pressure drop of pipes and other equipment in flow legs at port_1 and port_3"; parameter Real R = 50 "Rangeability, R=50...100 typically"; parameter Real delta0 = 0.01 "Range of significant deviation from equal percentage law"; parameter Real fraK(min=0, max=1) = 1.0 "Fraction Kv(port_3&rarr;port_2)/Kv(port_1&rarr;port_2)"; parameter Real[2] l(each min=0, each max=1) = {0.0001, 0.0001} "Valve leakage, l=Kv(y=0)/Kv(y=1)"; parameter Real deltaM = 0.02 "Fraction of nominal flow rate where linearization starts, if y=1"; parameter Boolean[2] linearized = {false, false} "= true, use linear relation between m_flow and dp for any flow rate"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow for dynamic energy and momentum balance"; parameter Boolean from_dp = true "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_1"; parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_2"; parameter Modelica.Fluid.Types.PortFlowDirection portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_3"; parameter Boolean verifyFlowReversal = false "=true, to assert that the flow does not reverse when portFlowDirection_* does not equal Bidirectional"; parameter Boolean use_inputFilter=true "= true, if 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"; final parameter Modelica.Units.SI.PressureDifference dp3Valve_nominal( displayUnit="Pa")=dpValve_nominal/fraK^2 "Bypass branch valve pressure drop at design conditions"; final parameter Modelica.Units.SI.PressureDifference dp3Fixed_nominal( displayUnit="Pa")=dpFixed_nominal[2] "Bypass branch fixed pressure drop at design conditions"; final parameter Modelica.Units.SI.PressureDifference dp3_nominal( displayUnit="Pa")=dp3Valve_nominal + dp3Fixed_nominal "Bypass branch total pressure drop at design conditions"; // Variables Modelica.Units.SI.MassFlowRate m1_flow = port_1.m_flow "Mass flow rate in direct branch"; Modelica.Units.SI.MassFlowRate m2_flow = -1 * port_2.m_flow "Mass flow rate in common branch"; Modelica.Units.SI.MassFlowRate m3_flow = port_3.m_flow "Mass flow rate in bypass branch"; Modelica.Units.SI.PressureDifference dp1(displayUnit="Pa") = port_1.p - port_2.p "Pressure drop across direct branch"; Modelica.Units.SI.PressureDifference dp3(displayUnit="Pa") = port_3.p - port_2.p "Pressure drop across bypass branch"; Modelica.Fluid.Interfaces.FluidPort_a port_1( redeclare final package Medium = Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default), m_flow(min=if (portFlowDirection_1 == Modelica.Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_1== Modelica.Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)) "First port, typically inlet"; Modelica.Fluid.Interfaces.FluidPort_b port_2( redeclare final package Medium = Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default), m_flow(min=if (portFlowDirection_2 == Modelica.Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_2 == Modelica.Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)) "Second port, typically outlet"; Modelica.Fluid.Interfaces.FluidPort_a port_3( redeclare final package Medium=Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default), m_flow(min=if (portFlowDirection_3==Modelica.Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_3==Modelica.Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)) "Third port, can be either inlet or outlet"; Buildings.Controls.OBC.CDL.Interfaces.RealInput y(final unit="1") "Input control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual "Actual actuator position"; Actuators.Valves.ThreeWayEqualPercentageLinear valEquLin( redeclare final package Medium = Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final R=R, final delta0=delta0, final l=l, final fraK=fraK, final deltaM=deltaM, final tau=tau, final from_dp=from_dp, final portFlowDirection_1=portFlowDirection_1, final portFlowDirection_2=portFlowDirection_2, final portFlowDirection_3=portFlowDirection_3, final verifyFlowReversal=verifyFlowReversal, final linearized=linearized, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha==Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage "Three-way valve with equal percentage and linear characteristics"; Actuators.Valves.ThreeWayLinear valLinLin( redeclare final package Medium = Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final l=l, final fraK=fraK, final deltaM=deltaM, final tau=tau, final from_dp=from_dp, final portFlowDirection_1=portFlowDirection_1, final portFlowDirection_2=portFlowDirection_2, final portFlowDirection_3=portFlowDirection_3, final verifyFlowReversal=verifyFlowReversal, final linearized=linearized, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha==Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Linear "Three-way valve with linear characteristics"; Actuators.Valves.ThreeWayTable valTab( redeclare final package Medium = Medium, final flowCharacteristics1=flowCharacteristics1, final flowCharacteristics3=flowCharacteristics3, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final fraK=fraK, final deltaM=deltaM, final tau=tau, final from_dp=from_dp, final portFlowDirection_1=portFlowDirection_1, final portFlowDirection_2=portFlowDirection_2, final portFlowDirection_3=portFlowDirection_3, final verifyFlowReversal=verifyFlowReversal, final linearized=linearized, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final C_nominal=C_nominal, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Table "Three-way valve with table-specified characteristics"; initial equation assert(typCha<>Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.PressureIndependent, "In " + getInstanceName() + ": The pressure independent option is only available for two-way valves."); equation connect(y, valEquLin.y); connect(valEquLin.y_actual, y_actual); connect(port_3, valEquLin.port_3); connect(valEquLin.port_2, port_2); connect(port_1, valEquLin.port_1); connect(port_1, valLinLin.port_1); connect(y, valLinLin.y); connect(valLinLin.port_3, port_3); connect(y, valTab.y); connect(valTab.port_1, port_1); connect(port_3, valTab.port_3); connect(valTab.port_2, port_2); connect(valTab.y_actual, y_actual); connect(valLinLin.y_actual, y_actual); connect(valLinLin.port_2, port_2); end ThreeWayValve;

Buildings.Fluid.HydronicConfigurations.Components.TwoWayValve Buildings.Fluid.HydronicConfigurations.Components.TwoWayValve

Container class for two-way valves

Buildings.Fluid.HydronicConfigurations.Components.TwoWayValve

Information

This is a container class for two-way valve models from Buildings.Fluid.Actuators.Valves. Note that the models Buildings.Fluid.Actuators.Valves.TwoWayPolynomial and Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening are not represented.

The parameter typCha allows configuring the model by selecting the valve characteristic to be used based on the enumeration Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.

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

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
GenericflowCharacteristicsflowCharacteristics(y={0,1},...Table with flow characteristics
RealR50Rangeability, R=50...100 typically
Realdelta00.01Range of significant deviation from equal percentage law
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedpValve_nominal Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint [Pa]
PressureDifferencedpFixed_nominal0Pressure drop of pipe and other resistances that are in series [Pa]
Flow Coefficient
CvTypesCvDataBuildings.Fluid.Types.CvType...Selection of flow coefficient
RealKv Kv (metric) flow coefficient [m3/h/(bar)^(1/2)]
RealCv Cv (US) flow coefficient [USG/min/(psi)^(1/2)]
AreaAv Av (metric) flow coefficient [m2]
Pressure-flow linearization
RealdeltaM0.02Fraction of nominal flow rate where linearization starts, if y=1
Configuration
ValveCharacteristictypChaBuildings.Fluid.HydronicConf...Valve characteristic
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
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
Dynamics
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
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_inputFiltertrue= true, if opening 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
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.)

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 RealInputyInput control signal [1]
output RealOutputy_actualActual actuator position

Modelica definition

model TwoWayValve "Container class for two-way valves" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface; extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations( final massDynamics=energyDynamics, final mSenFac=1); extends Buildings.Fluid.Actuators.BaseClasses.ValveParameters( rhoStd=Medium.density_pTX(101325, 273.15+4, Medium.X_default)); parameter Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic typCha=Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage "Valve characteristic"; parameter Modelica.Units.SI.PressureDifference dpFixed_nominal( displayUnit="Pa", min=0) = 0 "Pressure drop of pipe and other resistances that are in series"; parameter Real l(min=1e-10, max=1) = 0.0001 "Valve leakage, l=Kv(y=0)/Kv(y=1)"; parameter Buildings.Fluid.Actuators.Valves.Data.Generic flowCharacteristics( y={0,1}, phi={0.0001,1}) "Table with flow characteristics"; parameter Real R=50 "Rangeability, R=50...100 typically"; parameter Real delta0=0.01 "Range of significant deviation from equal percentage law"; 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"; parameter Boolean use_inputFilter=true "= true, if 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"; Buildings.Controls.OBC.CDL.Interfaces.RealInput y(final unit="1") "Input control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y_actual "Actual actuator position"; Actuators.Valves.TwoWayEqualPercentage valEqu( redeclare final package Medium=Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final R=R, final delta0=delta0, final l=l, final deltaM=deltaM, final from_dp=from_dp, final allowFlowReversal=allowFlowReversal, final linearized=linearized, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage "Two-way valve with equal percentage characteristic"; Actuators.Valves.TwoWayLinear valLin( redeclare final package Medium = Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final l=l, final deltaM=deltaM, final from_dp=from_dp, final allowFlowReversal=allowFlowReversal, final linearized=linearized, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Linear "Two-way valve with linear characteristic"; Actuators.Valves.TwoWayTable valTab( redeclare final package Medium = Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final deltaM=deltaM, final from_dp=from_dp, final allowFlowReversal=allowFlowReversal, final linearized=linearized, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start, final flowCharacteristics=flowCharacteristics) if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.Table "Two-way valve with table-specified characteristic"; Actuators.Valves.TwoWayPressureIndependent valPre( redeclare final package Medium=Medium, final CvData=Buildings.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal, final dpValve_nominal=dpValve_nominal, final rhoStd=rhoStd, final dpFixed_nominal=dpFixed_nominal, final l=l, final deltaM=deltaM, final from_dp=from_dp, final allowFlowReversal=allowFlowReversal, final use_inputFilter=use_inputFilter, final riseTime=riseTime, final init=init, final y_start=y_start) if typCha == Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.PressureIndependent "Pressure-independent two-way valve"; initial equation assert(dpFixed_nominal > -Modelica.Constants.eps, "In " + getInstanceName() + ": Model requires dpFixed_nominal >= 0 but received dpFixed_nominal = " + String(dpFixed_nominal) + " Pa."); equation connect(y, valEqu.y); connect(valEqu.y_actual, y_actual); connect(port_a, valEqu.port_a); connect(valEqu.port_b, port_b); connect(port_a, valTab.port_a); connect(port_a, valLin.port_a); connect(valLin.port_b, port_b); connect(valLin.y_actual, y_actual); connect(y, valLin.y); connect(y, valTab.y); connect(valTab.port_b, port_b); connect(valTab.y_actual, y_actual); connect(port_a, valPre.port_a); connect(valPre.port_b, port_b); connect(y, valPre.y); connect(valPre.y_actual, y_actual); end TwoWayValve;