3-way flow control valve in an isothermal system
Simscape / Fluids / Isothermal Liquid / Valves & Orifices / Directional Control Valves

The 3-Way Directional Valve (IL) block represents a directional control valve with three ports and two positions. For example, this block could provide flow control between a pump, storage tank, and actuator.
Example Valve Configuration

Valve control occurs through the spool, which is connected to a physical signal at port S. In the default configuration, zero displacement indicates a fully closed valve between positions I and II. A negative displacement shifts the spool toward valve position I, and a positive displacement signal shifts the spool toward valve position II.
Fluid can flow between port A and port T (figure I) or between port P and port A (figure II). The block uses the same formulation for flow rate and opening area as the Orifice (IL) block. See Orifice (IL) for more details on flow calculation.
Valve Positions

The Orifice parameterization sets the method for calculating the valve
open area. The calculations are based either on the orifice parameters or tabulated
data sets specified in the Model Parameterization tab. The
block uses the same data for both flow paths if Area
characteristics is set to Identical for all flow
paths; otherwise, individual equations are applied for the
Different for all flow paths setting. The orifice
parameterizations are:
Linear - area vs. spool travel
The opening area is a linear function of the spool travel distance, the signal received at port S:
where:
Smin is the control member position when the orifice is fully closed.
ΔS is the Control member travel between closed and open orifice.
Amax is the Maximum orifice area.
Aleak is the Leakage area.
ε is the orifice opening orientation. For
the P-A flow path, it is 1. For the A-T flow
path, it is -1.

Tabulated data - Area vs. spool travel
Provide spool travel vectors for your system or for individual flow paths between ports P and A and ports A and T. This data will be used to calculate the relationship between the orifice opening area and spool travel distance. Interpolation is used to determine the opening area between given data points. Aleak and Amax are the first and last parameters of the Opening area vector, respectively.

Tabulated data - Volumetric flow rate vs. spool travel and
pressure drop
Provide spool travel and pressure drop vectors. The volumetric flow rate is calculated based on the relationship between pressure change and the spool travel distance. Interpolation is used to determine flow rate between given data points. The mass flow rate is the product of the volumetric flow rate and the local density.

When the valve is in a near-open or near-closed position in the linear parameterization, you can maintain numerical robustness in your simulation by adjusting the block Smoothing factor. A smoothing function is applied to all calculated areas, but primarily influences the simulation at the extremes of the valve area.
The normalized valve area is calculated as:
The Smoothing factor, s, is applied to the normalized area:
The smoothed valve area is:
The block is a composite of two Orifice (IL) blocks that are driven by a single physical signal at S. Block Orifice P-A represents the flow path between ports P and A. Block Orifice A-T represents the flow path between ports A and T.
In the diagram below, a positive signal opens Orifice P-A while closing Orifice A-T. A negative signal opens Orifice A-T while closing Orifice P-A.
Valve Structural Diagram

The initial valve position is determined by the opening offset, or the orifice opening at zero spool displacement. An offset can be due to a change in distance between ports or spool lands. It can also be due to a change in the thicknesses of the spool lands. Orifice opening is determined in the same way as for the Orifice (IL) block.
Fluid inertia is ignored.
Spool loading due to inertial, spring, and other forces is ignored.
All valve orifices are assumed to be identical in size unless otherwise specified.
2-Way Directional Valve (IL) | 4-Way 3-Position Directional Valve (IL) | Orifice (IL) | Pressure-Compensated 3-Way Flow Control Valve (IL) | Pressure-Reducing 3-Way Valve (IL)