modelValve

Multiple-configuration valve

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

Information

This is a container model that can be used to represent a variety of valves, with a variety of characteristics. The supported types of valve are described in the enumeration Buildings.Templates.Components.Types.Valve. The supported flow characteristics are described in the enumeration Buildings.Templates.Components.Types.ValveCharacteristicTwoWay for two-way valves, and in the enumeration Buildings.Templates.Components.Types.ValveCharacteristicThreeWay for three-way valves.

Control points

The following input and output points are available.

For modulating valves:

  • The valve position is modulated with a fractional position signal y (real).
    y = 0 corresponds to fully closed (fully open bypass for three-way valves). y = 1 corresponds to fully open (fully closed bypass for three-way valves).
  • The actual valve position y_actual (real) is returned.
    y_actual = 0 corresponds to fully closed. y_actual = 1 corresponds to fully open.

For two-position valves:

  • The valve position is commanded with a Boolean signal y1.
    y1 = false corresponds to fully closed (fully open bypass for three-way valves). y1 = true corresponds to fully open (fully closed bypass for three-way valves).
  • The open end switch status y1_actual and closed end switch status y0_actual (Booleans) are returned.
    y1_actual = false corresponds to fully closed. y1_actual = true corresponds to fully open. And the opposite for y0_actual.

Model parameters

The design operating point is specified with an instance of Buildings.Templates.Components.Data.Valve.

The default characteristic is equal percentage (resp. equal percentage and linear) for modulating two-way valves (resp. modulating three-way valves). The default characteristic is linear for two-position actuators.

For three-way valves, 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 rationale.

Parameters

TypeNameDefaultDescription
Booleanis_twoWaytyp == Buildings.Templates.Components.Types.Valve.TwoWayModulating or typ == Buildings.Templates.Components.Types.Valve.TwoWayTwoPositionEvaluate to true in case of two-way valve
Booleanis_thrWaytyp == Buildings.Templates.Components.Types.Valve.ThreeWayModulating or typ == Buildings.Templates.Components.Types.Valve.ThreeWayTwoPositionEvaluate to true in case of three-way valve
Booleanis_actTwotyp == Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition or typ == Buildings.Templates.Components.Types.Valve.ThreeWayTwoPositionEvaluate to true in case of two-position actuator
Booleanis_actModtyp == Buildings.Templates.Components.Types.Valve.ThreeWayModulating or typ == Buildings.Templates.Components.Types.Valve.TwoWayModulatingEvaluate to true in case of modulating actuator
Buildings.Templates.Components.Data.ValvedatDesign and operating parameters
Modelica.Units.SI.PressureDifferencedpValve_nominaldat.dpValve_nominalNominal pressure drop of fully open valve
Modelica.Units.SI.PressureDifferencedpFixed_nominaldat.dpFixed_nominalNominal pressure drop of pipes and other equipment in flow leg
Modelica.Units.SI.PressureDifferencedpFixedByp_nominaldat.dpFixedByp_nominalNominal pressure drop in the bypass line
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialTwoPortInterface)Nominal mass flow rate
Advanced
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialTwoPortInterface)1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
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
Advanced › Diagnostics
Booleanshow_T (from PartialTwoPortInterface)false= true, if actual temperature at port is computed
Configuration
Buildings.Templates.Components.Types.ValvetypEquipment type
Buildings.Templates.Components.Types.ValveCharacteristicTwoWaychaTwoif is_actMod then Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.EqualPercentage else Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.LinearFlow characteristic
Buildings.Templates.Components.Types.ValveCharacteristicThreeWaychaThrif is_actMod then Buildings.Templates.Components.Types.ValveCharacteristicThreeWay.EqualPercentageLinear else Buildings.Templates.Components.Types.ValveCharacteristicThreeWay.LinearFlow characteristic
Buildings.Fluid.Actuators.Valves.Data.GenericflowCharacteristicsTable with flow characteristics
Buildings.Fluid.Actuators.Valves.Data.GenericflowCharacteristics1Table with flow characteristics for direct flow path at port_1
Buildings.Fluid.Actuators.Valves.Data.GenericflowCharacteristics3Table with flow characteristics for bypass flow path at port_3
RealfraK1.0Fraction Kv(port_3→port_2)/Kv(port_1→port_2)
Dynamics › Time needed to open or close valve
Booleanuse_strokeTimetrueSet to true to continuously open and close valve
Modelica.Units.SI.TimestrokeTime120Time needed to open or close valve
Modelica.Blocks.Types.InitinitModelica.Blocks.Types.Init.InitialOutputType of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial position of actuator
Dynamics › Nominal condition
Modelica.Units.SI.Timetau10Time constant at nominal flow
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamicsModelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPort)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPort)Fluid connector b (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_aportByp_aFluid connector with bypass line
Buildings.Templates.Components.Interfaces.BusbusControl bus

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow (from PartialTwoPortInterface)port_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp (from PartialTwoPortInterface)port_a.p - port_b.pPressure difference between port_a and port_b
Medium.ThermodynamicStatesta_a (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow)))Medium properties in port_a
Medium.ThermodynamicStatesta_b (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow))Medium properties in port_b
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealy1Two-position signal
Modelica.Blocks.Routing.RealPassThroughyModulating signal
Modelica.Blocks.Routing.RealPassThroughy_actualPosition feedback
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdy1_actualOpen end switch status
Buildings.Controls.OBC.CDL.Reals.LessThresholdy0_actualClosed end switch status
Buildings.Fluid.FixedResistances.PressureDropnonNo valve
Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentageequTwo-way valve with equal percentage characteristic
Buildings.Fluid.Actuators.Valves.TwoWayLinearlinTwo-way valve with linear characteristic
Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependentindPressure independent two-way valve
Buildings.Fluid.Actuators.Valves.TwoWayTabletabPressure independent two-way valve
Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearequLinThree-way valve with equal percentage and linear characteristics
Fluid.Actuators.Valves.ThreeWayLinearlinLinThree-way valve with linear characteristics
Fluid.Actuators.Valves.ThreeWayTabletabTabThree-way valve with table-specified characteristics

Revisions

  • May 7, 2025, by Antoine Gautier:
    Replaced direct fluid pass-through with fixed resistance.
    This is for #4227.
  • September 27, 2023, by Antoine Gautier:
    First implementation.