modelValve
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 = 0corresponds to fully closed (fully open bypass for three-way valves).y = 1corresponds to fully open (fully closed bypass for three-way valves). -
The actual valve position
y_actual(real) is returned.
y_actual = 0corresponds to fully closed.y_actual = 1corresponds to fully open.
For two-position valves:
-
The valve position is commanded with a Boolean signal
y1.
y1 = falsecorresponds to fully closed (fully open bypass for three-way valves).y1 = truecorresponds to fully open (fully closed bypass for three-way valves). -
The open end switch status
y1_actualand closed end switch statusy0_actual(Booleans) are returned.
y1_actual = falsecorresponds to fully closed.y1_actual = truecorresponds to fully open. And the opposite fory0_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
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | is_twoWay | typ == Buildings.Templates.Components.Types.Valve.TwoWayModulating or typ == Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition | Evaluate to true in case of two-way valve |
| Boolean | is_thrWay | typ == Buildings.Templates.Components.Types.Valve.ThreeWayModulating or typ == Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition | Evaluate to true in case of three-way valve |
| Boolean | is_actTwo | typ == Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition or typ == Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition | Evaluate to true in case of two-position actuator |
| Boolean | is_actMod | typ == Buildings.Templates.Components.Types.Valve.ThreeWayModulating or typ == Buildings.Templates.Components.Types.Valve.TwoWayModulating | Evaluate to true in case of modulating actuator |
| Buildings.Templates.Components.Data.Valve | dat | Design and operating parameters | |
| Modelica.Units.SI.PressureDifference | dpValve_nominal | dat.dpValve_nominal | Nominal pressure drop of fully open valve |
| Modelica.Units.SI.PressureDifference | dpFixed_nominal | dat.dpFixed_nominal | Nominal pressure drop of pipes and other equipment in flow leg |
| Modelica.Units.SI.PressureDifference | dpFixedByp_nominal | dat.dpFixedByp_nominal | Nominal pressure drop in the bypass line |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal (from PartialTwoPortInterface) | Nominal mass flow rate | |
| Advanced | |||
| Modelica.Units.SI.MassFlowRate | m_flow_small (from PartialTwoPortInterface) | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialTwoPortInterface) | false | = true, if actual temperature at port is computed |
| Configuration | |||
| Buildings.Templates.Components.Types.Valve | typ | Equipment type | |
| Buildings.Templates.Components.Types.ValveCharacteristicTwoWay | chaTwo | if is_actMod then Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.EqualPercentage else Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.Linear | Flow characteristic |
| Buildings.Templates.Components.Types.ValveCharacteristicThreeWay | chaThr | if is_actMod then Buildings.Templates.Components.Types.ValveCharacteristicThreeWay.EqualPercentageLinear else Buildings.Templates.Components.Types.ValveCharacteristicThreeWay.Linear | Flow characteristic |
| Buildings.Fluid.Actuators.Valves.Data.Generic | flowCharacteristics | Table with flow characteristics | |
| Buildings.Fluid.Actuators.Valves.Data.Generic | flowCharacteristics1 | Table with flow characteristics for direct flow path at port_1 | |
| Buildings.Fluid.Actuators.Valves.Data.Generic | flowCharacteristics3 | Table with flow characteristics for bypass flow path at port_3 | |
| Real | fraK | 1.0 | Fraction Kv(port_3→port_2)/Kv(port_1→port_2) |
| Dynamics › Time needed to open or close valve | |||
| Boolean | use_strokeTime | true | Set to true to continuously open and close valve |
| Modelica.Units.SI.Time | strokeTime | 120 | Time needed to open or close valve |
| Modelica.Blocks.Types.Init | init | Modelica.Blocks.Types.Init.InitialOutput | Type of initialization (no init/steady state/initial state/initial output) |
| Real | y_start | 1 | Initial position of actuator |
| Dynamics › Nominal condition | |||
| Modelica.Units.SI.Time | tau | 10 | Time constant at nominal flow |
| Dynamics › Conservation equations | |||
| Modelica.Fluid.Types.Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamics.DynamicFreeInitial | Type of energy balance: dynamic (3 initialization options) or steady state |
| Graphics | |||
| Integer | text_rotation | 0 | Text rotation angle in icon layer |
| Boolean | text_flip | false | True to flip text horizontally in icon layer |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_a | portByp_a | Fluid connector with bypass line | |
| Buildings.Templates.Components.Interfaces.Bus | bus | Control bus |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow (from PartialTwoPortInterface) | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp (from PartialTwoPortInterface) | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_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.ThermodynamicState | sta_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.BooleanToReal | y1 | Two-position signal | |
| Modelica.Blocks.Routing.RealPassThrough | y | Modulating signal | |
| Modelica.Blocks.Routing.RealPassThrough | y_actual | Position feedback | |
| Buildings.Controls.OBC.CDL.Reals.GreaterThreshold | y1_actual | Open end switch status | |
| Buildings.Controls.OBC.CDL.Reals.LessThreshold | y0_actual | Closed end switch status | |
| Buildings.Fluid.FixedResistances.PressureDrop | non | No valve | |
| Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage | equ | Two-way valve with equal percentage characteristic | |
| Buildings.Fluid.Actuators.Valves.TwoWayLinear | lin | Two-way valve with linear characteristic | |
| Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent | ind | Pressure independent two-way valve | |
| Buildings.Fluid.Actuators.Valves.TwoWayTable | tab | Pressure independent two-way valve | |
| Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear | equLin | Three-way valve with equal percentage and linear characteristics | |
| Fluid.Actuators.Valves.ThreeWayLinear | linLin | Three-way valve with linear characteristics | |
| Fluid.Actuators.Valves.ThreeWayTable | tabTab | Three-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.