Buildings.Fluid.Actuators.Valves

Package with valve models

Information

This package contains component models for two- and three-way valves. For motor models, see Buildings.Fluid.Actuators.Motors.

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

Package Content

Name Description
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear ThreeWayEqualPercentageLinear Three way valve with equal percentage and linear characteristics
Buildings.Fluid.Actuators.Valves.ThreeWayLinear ThreeWayLinear Three way valve with linear characteristics
Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage TwoWayEqualPercentage Two way valve with equal percentage flow characteristics
Buildings.Fluid.Actuators.Valves.TwoWayLinear TwoWayLinear Two way valve with linear flow characteristics
Buildings.Fluid.Actuators.Valves.TwoWayPolynomial TwoWayPolynomial Two way valve with polynomial characteristic
Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent TwoWayPressureIndependent Model of a pressure-independent two way valve
Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening TwoWayQuickOpening Two way valve with quick opening flow characteristics
Buildings.Fluid.Actuators.Valves.TwoWayTable TwoWayTable Two way valve with table-specified flow characteristics
Buildings.Fluid.Actuators.Valves.Data Data Data records for table-based valves
Buildings.Fluid.Actuators.Valves.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluid.Actuators.Valves.Validation Validation Collection of validation models

Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear

Three way valve with equal percentage and linear characteristics

Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear

Information

Three way valve with equal percentage characteristics between port_1 and port_2 and linear opening characteristic between port_3 and port_2. Such opening characteristics were typical for valves from Landis & Gyr (now Siemens).

This model is based on the partial valve models Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve and Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. See Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve for the implementation of the three way valve and see Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve for the implementation of the regularization near the origin.

Extends from BaseClasses.PartialThreeWayValve (Partial three way valve).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
RealfraK0.7Fraction Kv(port_3→port_2)/Kv(port_1→port_2)
Reall[2]{0.0001,0.0001}Valve leakage, l=Kv(y=0)/Kv(y=1)
RealR50Rangeability, R=50...100 typically
Realdelta00.01Range of significant deviation from equal percentage law
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]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output
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_smallm_flow_nominal*1e-4Small mass flow rate for checking flow reversal [kg/s]
Booleanlinearized[2]{false,false}= true, use linear relation between m_flow and dp for any flow rate
BooleanhomotopyInitializationtrue= true, use homotopy method
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model ThreeWayEqualPercentageLinear "Three way valve with equal percentage and linear characteristics" extends BaseClasses.PartialThreeWayValve( redeclare TwoWayEqualPercentage res1(R=R, delta0=delta0), redeclare TwoWayLinear res3); parameter Real R = 50 "Rangeability, R=50...100 typically"; parameter Real delta0 = 0.01 "Range of significant deviation from equal percentage law"; equation connect(inv.y, res3.y); connect(y_actual, inv.u2); connect(y_actual, res1.y); end ThreeWayEqualPercentageLinear;

Buildings.Fluid.Actuators.Valves.ThreeWayLinear Buildings.Fluid.Actuators.Valves.ThreeWayLinear

Three way valve with linear characteristics

Buildings.Fluid.Actuators.Valves.ThreeWayLinear

Information

Three way valve with linear opening characteristic.

This model is based on the partial valve models Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve and Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. See Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve for the implementation of the three way valve and see Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve for the implementation of the regularization near the origin.

Extends from BaseClasses.PartialThreeWayValve (Partial three way valve).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
RealfraK0.7Fraction Kv(port_3→port_2)/Kv(port_1→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]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output
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_smallm_flow_nominal*1e-4Small mass flow rate for checking flow reversal [kg/s]
Booleanlinearized[2]{false,false}= true, use linear relation between m_flow and dp for any flow rate
BooleanhomotopyInitializationtrue= true, use homotopy method
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model ThreeWayLinear "Three way valve with linear characteristics" extends BaseClasses.PartialThreeWayValve( redeclare TwoWayLinear res1, redeclare TwoWayLinear res3); equation connect(inv.y, res3.y); connect(y_actual, inv.u2); connect(y_actual, res1.y); end ThreeWayLinear;

Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage

Two way valve with equal percentage flow characteristics

Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage

Information

Two way valve with an equal percentage valve opening characteristic.

This model is based on the partial valve model Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.

Extends from BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
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
Custom Parameters
Realphiif homotopyInitialization th...Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayEqualPercentage "Two way valve with equal percentage flow characteristics" extends BaseClasses.PartialTwoWayValveKv(phi=if homotopyInitialization then homotopy(actual=Buildings.Fluid.Actuators.BaseClasses.equalPercentage( y_actual, R, l, delta0), simplified=l + y_actual*(1 - l)) else Buildings.Fluid.Actuators.BaseClasses.equalPercentage( y_actual, R, l, delta0)); parameter Real R=50 "Rangeability, R=50...100 typically"; parameter Real delta0=0.01 "Range of significant deviation from equal percentage law"; initial equation // Since the flow model Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow computes // 1/k^2, the parameter l must not be zero. assert(l > 0, "Valve leakage parameter l must be bigger than zero."); assert(l < 1/R, "Wrong parameters in valve model.\n" + " Rangeability R = " + String(R) + "\n" + " Leakage flow l = " + String(l) + "\n" + " Must have l < 1/R = " + String(1/R)); end TwoWayEqualPercentage;

Buildings.Fluid.Actuators.Valves.TwoWayLinear Buildings.Fluid.Actuators.Valves.TwoWayLinear

Two way valve with linear flow characteristics

Buildings.Fluid.Actuators.Valves.TwoWayLinear

Information

Two way valve with linear opening characteristic.

This model is based on the partial valve model Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.

Extends from BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
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
Custom Parameters
Realphil + y_actual*(1 - l)Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayLinear "Two way valve with linear flow characteristics" extends BaseClasses.PartialTwoWayValveKv(phi=l + y_actual*(1 - l)); initial equation // Since the flow model Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow computes // 1/k^2, the parameter l must not be zero. assert(l > 0, "Valve leakage parameter l must be bigger than zero."); end TwoWayLinear;

Buildings.Fluid.Actuators.Valves.TwoWayPolynomial Buildings.Fluid.Actuators.Valves.TwoWayPolynomial

Two way valve with polynomial characteristic

Buildings.Fluid.Actuators.Valves.TwoWayPolynomial

Information

Two way valve with polynomial opening characteristic. The polynomial coefficients are defined using parameter c. The elements of c are coefficients for increasing powers of y, starting with the power 0, which corresponds to a fixed offset. This valve model can be used to implement valves with a custom opening characteristic, such as a combination of a linear and an equal percentage characteristic.

This model is based on the partial valve model Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.

Extends from Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
Realc[:] Polynomial coefficients, starting with fixed offset
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
Custom Parameters
Realphil + pol_y*(1 - l)Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayPolynomial "Two way valve with polynomial characteristic" extends Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValveKv( phi=l + pol_y*(1 - l)); parameter Real[:] c "Polynomial coefficients, starting with fixed offset"; protected constant Integer nP = 100 "Number of points for initial algorithm test"; Real pol_y = sum(c.*{y_actual^i for i in 0:size(c,1)-1}) "Polynomial of valve control signal"; // Test the validity of the provided valve coefficients initial equation // We compute the analytic derivative of the polynomial for y=(1/points), // where the derivative of y^j = j*y^(j-1). if size(c, 1)>=2 then for i in 0:nP/2 loop assert(sum({c[j+1]*j*(i/nP)^(j-1) for j in 1:size(c, 1) - 1})>=0, "The provided valve polynomial coefficients do not lead to a strictly increasing characteristic for y=" + String(i/nP)+ ". This is not allowed."); end for; end if; assert(c[1]>=0, "The provided valve polynomial coefficients do not lead to a valve opening that is larger than or equal to zero for a control signal of zero."); assert(sum(c)<=1.1, "The provided valve polynomial coefficients do not lead to a valve opening that is smaller than or equal to one for a control signal of one."); end TwoWayPolynomial;

Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent

Model of a pressure-independent two way valve

Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent

Information

Two way valve with a pressure-independent valve opening characteristic. The mass flow rate is controlled such that it is nearly equal to its set point y*m_flow_nominal, unless the pressure dp is too low, in which case a regular Kv characteristic is used.

Main equations

First the minimum pressure head dp_min required for delivering the requested mass flow rate y*m_flow_nominal is computed. If dp > dp_min then the requested mass flow rate is supplied. If dp < dp_min then m_flow = Kv/sqrt(dp). Transition between these two flow regimes happens in a smooth way.

Typical use and important parameters

This model is configured by setting m_flow_nominal to the mass flow rate that the valve should supply when it is completely open, i.e., y = 1. The pressure drop corresponding to this working point can be set using dpValve_nominal, or using a Kv, Cv or Av value. The parameter dpValve_fixed can be used to add additional pressure drops, although in this valve it is equivalent to add these to dpValve_nominal.

The parameter l2 represents the non-ideal leakage behaviour of this valve for high pressures. It is assumed that the mass flow rate will rise beyond the requested mass flow rate y*m_flow_nominal if dp > dpValve_nominal+dpFixed_nominal. The parameter l2 represents the slope of this rise: d(m_flow)/d(dp) = l2* m_flow_nominal/dp_nominal. In the ideal case l2=0, but this may introduce singularities, for instance when connecting this component with a fixed mass flow source.

Options

Parameter deltax sets the duration of the transition region between the two flow regimes as a fraction of dp_nominal or m_flow_nominal, depending on the value of from_dp.

Implementation

Note that the result in the transition region when using from_dp = true is not identical to the result when using from_dp = false.

Variables *_y1 and *_y2 serve a dual use. They are used to 1) compute the support points at *_x1 and *_x2, which should not depend on m_flow or dp and 2) to compute the flow functions when outside of this regime, which does depend on m_flow or dp. Min and max functions are therefore used such that one equation can serve both puroposes.

Extends from Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve (Partial model for a two way valve).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
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
Custom Parameters
Realphil + y_actual*(1 - l)Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dptrue= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Reall20.01Gain for mass flow increase if pressure is above nominal pressure
Realdeltax0.02Transition interval for flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayPressureIndependent "Model of a pressure-independent two way valve" extends Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve( final linearized = false, from_dp=true, phi=l + y_actual*(1 - l)); parameter Real l2(min=1e-10) = 0.01 "Gain for mass flow increase if pressure is above nominal pressure"; parameter Real deltax = 0.02 "Transition interval for flow rate"; protected parameter Real coeff1 = l2/dp_nominal*m_flow_nominal "Parameter for avoiding unnecessary computations"; parameter Real coeff2 = 1/coeff1 "Parameter for avoiding unnecessary computations"; constant Real y2dd = 0 "Second derivative at second support point"; Modelica.SIunits.MassFlowRate m_flow_set "Requested mass flow rate"; Modelica.SIunits.PressureDifference dp_min(displayUnit="Pa") "Minimum pressure difference required for delivering requested mass flow rate"; Modelica.SIunits.PressureDifference dp_x, dp_x1, dp_x2, dp_y2, dp_y1 "Support points for interpolation flow functions"; Modelica.SIunits.MassFlowRate m_flow_x, m_flow_x1, m_flow_x2, m_flow_y2, m_flow_y1 "Support points for interpolation flow functions"; Modelica.SIunits.MassFlowRate m_flow_smooth "Smooth interpolation result between two flow regimes"; Modelica.SIunits.PressureDifference dp_smooth "Smooth interpolation result between two flow regimes"; equation m_flow_set = m_flow_nominal*phi; kVal = Kv_SI; if (dpFixed_nominal > Modelica.Constants.eps) then k = sqrt(1/(1/kFixed^2 + 1/kVal^2)); else k = kVal; end if; dp_min = Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow( m_flow=m_flow_set, k=k, m_flow_turbulent=m_flow_turbulent); if from_dp then m_flow_x=0; m_flow_x1=0; m_flow_x2=0; dp_y1=0; dp_y2=0; dp_smooth=0; dp_x = dp-dp_min; dp_x1 = -dp_x2; dp_x2 = deltax*dp_min; // min function ensures that m_flow_y1 does not increase further for dp_x > dp_x1 m_flow_y1 = Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp( dp=min(dp, dp_min+dp_x1), k=k, m_flow_turbulent=m_flow_turbulent); // max function ensures that m_flow_y2 does not decrease further for dp_x < dp_x2 m_flow_y2 = m_flow_set + coeff1*max(dp_x,dp_x2); m_flow_smooth = noEvent(smooth(2, if dp_x <= dp_x1 then m_flow_y1 elseif dp_x >=dp_x2 then m_flow_y2 else Buildings.Utilities.Math.Functions.quinticHermite( x=dp_x, x1=dp_x1, x2=dp_x2, y1=m_flow_y1, y2=m_flow_y2, y1d= Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der( dp=dp_min + dp_x1, k=k, m_flow_turbulent=m_flow_turbulent, dp_der=1), y2d=coeff1, y1dd=Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der2( dp=dp_min + dp_x1, k=k, m_flow_turbulent=m_flow_turbulent, dp_der=1, dp_der2=0), y2dd=y2dd))); else dp_x=0; dp_x1=0; dp_x2=0; m_flow_y1=0; m_flow_y2=0; m_flow_smooth=0; m_flow_x = m_flow-m_flow_set; m_flow_x1 = -m_flow_x2; m_flow_x2 = deltax*m_flow_set; // min function ensures that dp_y1 does not increase further for m_flow_x > m_flow_x1 dp_y1 = Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow( m_flow=min(m_flow, m_flow_set + m_flow_x1), k=k, m_flow_turbulent=m_flow_turbulent); // max function ensures that dp_y2 does not decrease further for m_flow_x < m_flow_x2 dp_y2 = dp_min + coeff2*max(m_flow_x, m_flow_x2); dp_smooth = noEvent(smooth(2, if m_flow_x <= m_flow_x1 then dp_y1 elseif m_flow_x >=m_flow_x2 then dp_y2 else Buildings.Utilities.Math.Functions.quinticHermite( x=m_flow_x, x1=m_flow_x1, x2=m_flow_x2, y1=dp_y1, y2=dp_y2, y1d=Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_der( m_flow=m_flow_set + m_flow_x1, k=k, m_flow_turbulent=m_flow_turbulent, m_flow_der=1), y2d=coeff2, y1dd=Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_der2( m_flow=m_flow_set + m_flow_x1, k=k, m_flow_turbulent=m_flow_turbulent, m_flow_der=1, m_flow_der2=0), y2dd=y2dd))); end if; if homotopyInitialization then if from_dp then m_flow=homotopy(actual=m_flow_smooth, simplified=m_flow_nominal_pos*dp/dp_nominal_pos); else dp=homotopy( actual=dp_smooth, simplified=dp_nominal_pos*m_flow/m_flow_nominal_pos); end if; else if from_dp then m_flow=m_flow_smooth; else dp=dp_smooth; end if; end if; end TwoWayPressureIndependent;

Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening

Two way valve with quick opening flow characteristics

Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening

Information

Two way valve with a power function for the valve opening characteristic. Valves that need to open quickly typically have such a valve characteristics.

This model is based on the partial valve model Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.

Extends from BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Reall0.0001Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
Realalp2Parameter for valve characteristics, alp>0
Realdelta00.01Range of significant deviation from power 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
Custom Parameters
Realphiif homotopyInitialization th...Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayQuickOpening "Two way valve with quick opening flow characteristics" extends BaseClasses.PartialTwoWayValveKv(phi=if homotopyInitialization then homotopy(actual=l + Modelica.Fluid.Utilities.regPow( y_actual, alpInv, delta0)*(1 - l), simplified=l + y_actual*(1 - l)) else l + Modelica.Fluid.Utilities.regPow( y_actual, alpInv, delta0)*(1 - l)); parameter Real alp = 2 "Parameter for valve characteristics, alp>0"; parameter Real delta0 = 0.01 "Range of significant deviation from power law"; protected parameter Real alpInv = 1/alp "Inverse of alpha"; initial equation // Since the flow model Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow computes // 1/k^2, the parameter l must not be zero. assert(l > 0, "Valve leakage parameter l must be bigger than zero."); end TwoWayQuickOpening;

Buildings.Fluid.Actuators.Valves.TwoWayTable Buildings.Fluid.Actuators.Valves.TwoWayTable

Two way valve with table-specified flow characteristics

Buildings.Fluid.Actuators.Valves.TwoWayTable

Information

Two way valve with opening characteristic that is configured through a table.

The mass flow rate for the fully open valve is determined based on the value of the parameter CvData. For the different valve positions y ∈ [0, 1], this nominal flow rate is scaled by the values of the parameter flowCharacteristics. The parameter flowCharacteristics declares a table of the form

y 0 ... 1
φ l ... 1

where l = Kv(y=0)/Kv(y=1) > 0 is the valve leakage. The first row is the valve opening, and the second row is the mass flow rate, relative to the mass flow rate of the fully open valve, under the assumption of a constant pressure difference across the valve. A suggested value for the valve leakage is l=0.0001. If l = 0, then this model will replace it with l = 10-8 for numerical reasons. For example, if a valve has Kv=0.5 [m3/h/bar1/2] and a linear opening characteristics and a valve leakage of l=0.0001, then one would set

 CvData=Buildings.Fluid.Types.CvTypes.Kv
 Kv = 0.5
 flowCharacteristics(y={0,1}, phi={0.0001,1})
 

Note, however, that Buildings.Fluid.Actuators.Valves.TwoWayLinear provides a more efficient implementation for this simple case.

The parameter flowCharacteristics must meet the following requirements, otherwise the model stops with an error:

This model is based on the partial valve model Buildings.Fluid.Actuators.BaseClasses.PartialTwoWayValve. Check this model for more information, such as the regularization near the origin.

For an example that specifies an opening characteristics, see Buildings.Fluid.Actuators.Valves.Examples.TwoWayValveTable.

Extends from BaseClasses.PartialTwoWayValveKv (Partial model for a two way valve using a Kv characteristic).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
ReallphiLooUp.table[1, 2]Valve leakage, l=Kv(y=0)/Kv(y=1)
RealkFixedif dpFixed_nominal > Modelic...Flow coefficient of fixed resistance that may be in series with valve, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2).
GenericflowCharacteristics Table with flow characteristics
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
Custom Parameters
RealphiphiLooUp.y[1]Ratio actual to nominal mass flow rate of valve, phi=Kv(y)/Kv(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanhomotopyInitializationtrue= true, use homotopy method
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Nominal condition
DensityrhoStdMedium.density_pTX(101325, 2...Inlet density for which valve coefficients are defined [kg/m3]
Dynamics
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]
Integerorder2Order of filter
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial value of output

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 RealInputyActuator position (0: closed, 1: open)
output RealOutputy_actualActual valve position

Modelica definition

model TwoWayTable "Two way valve with table-specified flow characteristics" extends BaseClasses.PartialTwoWayValveKv( phi=phiLooUp.y[1], final l = phiLooUp.table[1, 2]); parameter Data.Generic flowCharacteristics "Table with flow characteristics"; // Since the flow model Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow computes // 1/k^2, the flowCharacteristics.phi[1] must not be zero. // We therefore set a lower bound. protected Modelica.Blocks.Tables.CombiTable1D phiLooUp( final tableOnFile=false, final table=[flowCharacteristics.y, cat( 1, {max(flowCharacteristics.phi[1], 1E-8)}, {flowCharacteristics.phi[i] for i in 2:size(flowCharacteristics.phi, 1)})], final columns=2:2, final smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) "Normalized mass flow rate for the given valve position under the assumption of a constant pressure"; initial equation assert(abs(flowCharacteristics.y[1]) < Modelica.Constants.eps, "flowCharateristics.y[1] must be 0."); assert(abs(flowCharacteristics.y[size(flowCharacteristics.y, 1)] - 1) < Modelica.Constants.eps, "flowCharateristics.y[end] must be 1."); assert(abs(flowCharacteristics.phi[size(flowCharacteristics.phi, 1)] - 1) < Modelica.Constants.eps, "flowCharateristics.phi[end] must be 1."); // Assert that the sequences are strictly monotonic increasing assert(Buildings.Utilities.Math.Functions.isMonotonic( x=flowCharacteristics.y, strict=true), "The values for y in flowCharacteristics must be strictly monotone increasing."); assert(Buildings.Utilities.Math.Functions.isMonotonic( x=flowCharacteristics.phi, strict=true), "The values for phi in flowCharacteristics must be strictly monotone increasing."); equation connect(phiLooUp.u[1], y_actual); end TwoWayTable;