Valve with longitudinally translating ball as control element

**Library:**Simscape / Fluids / Gas / Valves & Orifices / Flow Control Valves

The Ball Valve (G) block models an orifice with a
translating ball (technically a *poppet*) as a flow control
mechanism. The ball is sized to fully cover the orifice and arranged to shift in line
with the flow. Its seat is perforated, with the opening, part of the orifice through
which the flow must pass, being either sharp-edged or conical in shape. The distance of
the ball to the seat determines the opening area of the valve.

**Open ball valve with conical seat**

The flow can be laminar or turbulent, and it can reach (up to) sonic speeds. This happens at the vena contracta, a point just past the throat of the valve where the flow is both its narrowest and fastest. The flow then chokes and its velocity saturates, with a drop in downstream pressure no longer sufficing to increase its velocity. Choking occurs when the back-pressure ratio hits a critical value characteristic of the valve. Supersonic flow is not captured by the block.

Ball valves (generally) lack the opening characteristics to precisely modulate or throttle flow rate; they more commonly serve as shutoff and isolation valves, binary on/off switches which are often either fully open or maximally closed.

In a real valve, the ball often connects by a stem to a push button. When the button is pressed—by the magnetic force of a solenoid coil, say, or by the cyclical action of a rotary cam—the ball shifts from its seat, progressively opening the valve up to a maximum. A spring between the ball and the body of the valve acts as a return mechanism, allowing the ball to revert to its normal position once the button is released.

The block captures the motion of the ball but not the detail of its mechanics. The
motion derives from a normalized displacement specified as a physical signal at port
**L**. The normalization is with respect to the maximum
position of the ball (at which the valve is fully open). It helps to think of
displacement, position, and related quantities as fractions (normally from
`0`

to `1`

) rather than as lengths.

If the action of the push button and return spring matter in your model, you can capture these elements separately using other Simscape blocks. A Simscape Mechanical subsystem makes a good source for the ball displacement signal. In many cases, however, it suffices to know what displacement to impart to the ball. You can then usually ignore the mechanics of the valve.

The displacement signal allows the block to compute the instantaneous position of the ball, from which the opening of the valve follows. The opening is easily understood as a flow area but, for ease of modeling, it is often best expressed as a flow coefficient or sonic conductance. (The ``ease of modeling'' depends on the data available from the manufacturer.)

The position and displacement variables measure different things. The (instantaneous) position gives the distance of the ball to its resting place on the seat;

the displacement gives only that distance to its normal (unactuated) position. The normal position, a fixed coordinate, need not be zero: the ball can be installed so that it is normally off the seat. (The valve is then partially open even when it is disconnected and its poppet at rest.)

The normal distance between the ball and its seat is the valve lift control
offset, specified in the block parameter of the same name. Think of its as the
permanent displacement given to the ball while assembling the valve. The variable
displacement from port **L**, on the other hand, captures the
motion of the ball during operation of the valve, after it has been assembled and
installed. The instantaneous position of the ball is the sum of the two:

$$h(L)=L+{h}_{\text{0}},$$

where:

*h*is the instantaneous position of the ball, normalized against its maximum value. This variable can range from`0`

to`1`

, with`0`

giving a maximally closed valve and`1`

a fully open valve. If the calculation should return a number outside of this range, that number is set to the nearest bound (`0`

if the result is negative,`1`

otherwise). In other words, the normalized position*saturates*at`0`

and`1`

.*L*is the variable displacement of the ball, normalized against the maximum position of the same. This variable is obtained from the physical signal at port**L**. There are no restrictions on its value. You can make it smaller than`0`

or greater than`1`

, for example, to compensate for an equally extreme valve offset.*h*_{0}is the fixed offset of the ball relative to its seat in the normal position (when the valve is disconnected and free of inputs). Its value too is normalized against the maximum position of the ball, though there is no requirement that it lie between`0`

and`1`

.

The normalized position, *h*, spans three regions. At a
sufficiently small displacement, it saturates at `0`

and the valve
is fully closed. At a sufficiently large displacement, it saturates at
`1`

and the valve is fully open. In between, it varies linearly
between its saturation bounds, giving a valve that is partially open.

The transitions between the regions are sharp and their slopes discontinuous.
These pose a challenge to variable-step solvers (the sort commonly used with
Simscape models). To precisely capture discontinuities, referred to in some
contexts as *zero crossing events*, the solver must reduce its
time step, pausing briefly at the time of the crossing in order to recompute its
Jacobian matrix (a representation of the dependencies between the state variables of
the model and their time derivatives).

This solver strategy is efficient and robust when discontinuities are present. It makes the solver less prone to convergence errors—but it can considerably extend the time needed to finish the simulation run, perhaps excessively so for practical use in real-time simulation. An alternative approach, used here, is to remove the discontinuities altogether.

**Normalized position with sharp transitions**

To remove the slope discontinuities, the block smoothes them over a small portion of the opening curve. The smoothing, which adds a slight distortion at each transition, ensures that the valve eases into its limiting positions rather than snap (abruptly) into them. The smoothing is optional: you can disable it by setting its time scale to zero. The shape and scale of the smoothing, when applied, derives in part from the cubic polynomials:

$${\lambda}_{\text{L}}=3{\overline{h}}_{\text{L}}^{2}-2{\overline{h}}_{\text{L}}^{3}$$

and

$${\lambda}_{\text{R}}=3{\overline{h}}_{\text{R}}^{2}-2{\overline{h}}_{\text{R}}^{3},$$

where

$${\overline{h}}_{\text{L}}=\frac{h}{\Delta {h}^{*}}$$

and

$${\overline{h}}_{\text{R}}=\frac{h-\left(1-\Delta {h}^{*}\right)}{\Delta {h}^{*}}.$$

In the equations:

*ƛ*_{L}is the smoothing expression for the transition from the maximally closed position.*ƛ*_{R}is the smoothing expression for the transition from the fully open position.*Δp*^{*}is the (unitless) characteristic width of the smoothing region:$$\Delta {h}^{*}=\frac{1}{2}{f}^{*},$$

where

*f*^{*}is a smoothing factor valued between`0`

and`1`

and obtained from the block parameter of the same name.When the smoothing factor is

`0`

, the normalized ball position stays in its original form—no smoothing applied—and its transitions remain abrupt. When it is`1`

, the smoothing spans the whole of the ball's travel range (with the normalized ball position taking the shape of an*S*-curve).At intermediate values, the smoothing is limited to a fraction of that range. A value of

`0.5`

, for example, will smooth the transitions over a quarter of the travel range on each side (for a total smooth region of half that range).

The smoothing adds two new regions to the normalized ball position function—one for the smooth transition on the left, another for that on the right, giving a total of five regions. These are expressed in the piecewise function:

$${h}^{*}=\{\begin{array}{ll}0,\hfill & h\le 0\hfill \\ h{\lambda}_{\text{L}},\hfill & h<\Delta {h}^{*}\hfill \\ h,\hfill & h\le 1-\Delta {h}^{*}\hfill \\ h\left(1-{\lambda}_{\text{R}}\right)+{\lambda}_{\text{R}},\hfill & h<1\hfill \\ 1\hfill & h\ge 1\hfill \end{array},$$

where *h** is the smoothed valve opening area.
The figure shows the effect of smoothing on the sharpness of the transitions.

The opening area at a given ball position depends in part on the geometry of its
seat. That geometry, specified in the **Valve seat geometry**
parameter, can be either `Sharp-edged`

or
`Conical`

. In each case, the bottleneck region through
which the flow must pass is in the shape of a conical frustum. The lateral surface
of the frustum gives the opening area.

The frustum of a cone is any section of the same taken between two planes parallel to the base. In this block, the (imaginary) cone spans from the surface of the seat (where it has its base) to the center of the ball (its apex). The frustum is formed by cutting the cone where it intersects the ball.

The base of the cone, to be precise, is the ring of contact between the seat and the ball when the valve is in the closed position. The ring coincides with the edge of the seat only if it is sharp-edged. It lies inward from the edge if the seat is conical—somewhere along the conical surface between the orifice and the chamber of the ball.

A frustum of base radius *R*, top radius
*r*, and slant height *l* has for its lateral
surface area:

$$S=\pi (R+r)l.$$

To account for leakage flow, the block adds a small constant to this expression:

$$S=\pi (R+r)l+{S}_{\text{Leak}},$$

where *S*_{Leak} is the
small opening area that remains in the maximally closed valve due, for example,
to valve bore tolerances, surface defects, or an imperfect seal between the ball
and its seat. This area is obtained from the **Leakage area**
block parameter.

If the seat is sharp-edged, the radius of the base of the frustum is that of
the orifice itself (or half of the orifice diameter,
*D*_{O}, specified in the block). The
radius of the top face is a small decrement, *δ*, from that of
the base. The decrement and the slant height, *l*, are
functions of the normalized position of the ball (*h*). These
lengths are shown in the figure.

In terms of the orifice diameter, radius decrement, and slant height, the
frustum area (*S*) becomes:

$$S=\pi \left[{D}_{\text{O}}+\left({D}_{\text{O}}-2\delta \right)\right]l+{S}_{\text{Leak}}$$

Rearranged and written in terms of the orifice radius (2*R*_{O} =
*D*_{O}):

$$S=\pi \left(4{R}_{\text{O}}-2\delta \right)l+{S}_{\text{Leak}}$$

The values of *δ* and *l* are obtained from
expressions of trigonometry and proportion. These are based on the sides of the
triangles shown in the figure. $$\overline{CD}$$ corresponds to the radius decrement (*δ*) and $$\overline{CE}$$ to the slant height (*l*). $$\overline{OA}$$ is equal in length to the orifice radius.

Other relevant lengths include $$\overline{OE}$$ (half the diameter of the ball,
*R*_{B}) and $$\overline{CB}$$ (the position of the same, *h*). The various
lengths are more clearly shown in the figure below. The diameters of the orifice
(*R*_{O}) and of the ball
(*R*_{B}) are obtained from the block
parameters named for them. The ball position is calculated from the signal at
port **L**.

The slant height can now be expressed as:

$$l=OC-{R}_{\text{B}},$$

where *OC* is the distance from the center
of the ball (point **O**) to a point on the edge of the orifice
(**C**). From Pythagoras' theorem:

$$OC=\sqrt{{\left[h\rho +AB\right]}^{2}+{R}_{\text{O}}^{2}},$$

where *ρ* is the maximum ball position in
units of length (in contrast to the normalized ball position, which is
unitless). Its value is computed by solving the equality:

$$S(h)={S}_{\text{Max}},$$

where *S*_{Max} is the
maximum opening area:

$${S}_{\text{Max}}=\pi {R}_{\text{O}}^{2},$$

where *R*_{O} is the
radius of the orifice (half the value specified in the **Orifice
diameter** block parameter.

Similarly for length *AB*:

$$AB=\sqrt{{R}_{\text{B}}^{2}-{R}_{\text{O}}^{2}}$$

The radius decrement, *δ*, can likewise be expressed as:

$$\delta =\frac{l}{OC}{R}_{\text{O}}.$$

Combining these expressions and rearranging them, gives:

$$S=2\pi {R}_{\text{O}}OC\left[1-{\left(\frac{{R}_{\text{B}}}{OC}\right)}^{2}\right]+{S}_{\text{Leak}},$$

where *OC* is as defined above.

If the seat is conical, the ball comes to rest not on the rim of the orifice but on the conical surface that extends from it. The base of the frustum no longer matches the orifice in its radius and this variable is instead calculated from other lengths. The figure shows the frustum-shaped opening of the valve and the mismatch in size between its base and the orifice.

The calculations of the frustum dimensions are based on the triangles shown
below. As in the sharp-edged calculations, $$\overline{CD}$$ is the decrement in radius from base to top
(*δ*) and $$\overline{CE}$$ is the slant height of the frustum (*l*). The
length of $$\overline{OA}$$ gives the base radius.

Other relevant dimensions include the cone angle (*θ*, taken
between the sides of a cross section of the cone) and the ball radius
(*R*_{B}). These and other dimensions
are more clearly shown in the figure below.

In terms of these dimensions, the lateral surface area of the frustum is:

$$S=\pi \left(OA-2\delta \right)l+{S}_{\text{Leak}},$$

where *OA* is the radius of the base:

$$OA=\left(l+{R}_{\text{B}}\right)\text{cos}\left(\frac{\theta}{2}\right),$$

where *θ* is the angle between the side of the conical seat
and its center line, obtained from the **Cone angle** parameter
(specific to the `Conical`

parameterization). The slant
height of the frustum is:

$$l=\text{sin}\left(\frac{\theta}{2}\right)h\rho ,$$

where, as in the sharp-edged calculations,
*ρ* is the maximum position of the ball in units of length.
The decrement in radius from base to top is:

$$\delta =\text{cos}\left(\frac{\theta}{2}\right)l.$$

Combining these expressions, applying basic trigonometric relationships for double angles, and arranging terms gives for the opening area:

$$S=2\pi {R}_{\text{B}}h\rho \text{sin}(\theta )+\pi {h}^{2}{\rho}^{2}\text{sin}(\theta )\text{sin}\left(\frac{\theta}{2}\right)+{S}_{\text{Leak}},$$

As the opening area varies during simulation, so does the mass flow rate through the valve. The relationship between the two variables, however, is indirect. The mass flow rate is defined in terms of the valve's sonic conductance and it is this quantity that the opening area truly determines.

Sonic conductance, if you are unfamiliar with it, describes the ease with which a gas will flow when it is choked—when its velocity is at its theoretical maximum (the local speed of sound). Its measurement and calculation are covered in detail in the ISO 6358 standard (on which this block is based).

Only one value is commonly reported in valve data sheets: one taken at steady
state in the fully open position. This is the same specified in the block dialog box
(when the **Valve parameterization** setting is ```
Sonic
conductance
```

). For values across the opening range of the valve,
this maximum is scaled by the (normalized) valve opening area:

$$C(S)=\frac{S}{{S}_{\text{Max}}}{C}_{\text{Max}},$$

where *C* is sonic conductance and the subscript
`Max`

denotes the specified (manufacturer's) value. The sonic
conductance varies linearly between *C*_{Max}
in the fully open position and $${S}_{\text{Leak}}\xf7{S}_{\text{Max}}\times {C}_{\text{Max}}$$ in the maximally closed position—a value close to zero and due
only to internal leakage between the ports.

Because sonic conductance may not be available (or the most convenient choice
for your model), the block provides several equivalent parameterizations. Use
the **Valve parameterization** drop-down list to select the
best for the data at hand. The parameterizations are:

`Compute from geometry`

`Sonic conductance`

`Cv coefficient (USCS)`

`Kv coefficient (SI)`

The parameterizations differ only in the data that they require of you. Their
mass flow rate calculations are still based on sonic conductance. If you select
a parameterization other than `Sonic conductance`

, then
the block converts the alternate data—the (computed) opening area or a
(specified) flow coefficient—into an equivalent sonic conductance.

The flow coefficients measure what is, at bottom, the same quantity—the flow rate through the valve at some agreed-upon temperature and pressure differential. They differ only in the standard conditions used in their definition and in the physical units used in their expression:

*C*_{v}is measured at a generally accepted temperature of`60 ℉`

and pressure drop of`1 PSI`

; it is expressed in imperial units of`US gpm`

. This is the flow coefficient used in the model when the**Valve parameterization**block parameter is set to`Cv coefficient (USCS)`

.*K*_{v}is measured at a generally accepted temperature of`15 ℃`

and pressure drop of`1 bar`

; it is expressed in metric units of`m`

. This is the flow coefficient used in the model when the^{3}/h**Valve parameterization**block parameter is set to`Kv coefficient (SI)`

.

If the valve parameterization is set to ```
Cv Coefficient
(USCS)
```

, the sonic conductance is computed at the maximally
closed and fully open valve positions from the **Cv coefficient (SI) at
maximum flow** and **Cv coefficient (SI) at leakage
flow** block parameters:

$$C=\left(4\times {10}^{-8}{C}_{\text{v}}\right){m}^{3}/(sPa),$$

where *C*_{v} is the
flow coefficient value at maximum or leakage flow. The subsonic index,
*m*, is set to `0.5`

and the critical
pressure ratio, *b*_{cr}, is set to
`0.3`

. (These are used in the mass flow rate calculations
given in the Momentum Balance section.)

If the `Kv coefficient (SI)`

parameterization is used
instead, the sonic conductance is computed at the same valve positions
(maximally closed and fully open) from the **Kv coefficient (USCS) at
maximum flow** and **Kv coefficient (USCS) at leakage
flow** block parameters:

$$C=\left(4.758\times {10}^{-8}{K}_{\text{v}}\right){m}^{3}/(sPa),$$

where *K*_{v} is the
flow coefficient value at maximum or leakage flow. The subsonic index,
*m*, is set to `0.5`

and the critical
pressure ratio, *b*_{cr}, is set to
`0.3`

.

For the `Restriction area`

parameterization, the
sonic conductance is computed (at the same valve positions) from the
**Maximum opening area**, and **Leakage
area** block parameters:

$$C=\left(0.128\times 4{S}_{\text{R}}/\pi \right)L/(sbar),$$

where *S*_{R} is the
opening area at maximum or leakage flow. The subsonic index,
*m*, is set to `0.5`

while the critical
pressure ratio, *b*_{cr} is computed from
the expression:

$$0.41+0.272{\left(\frac{{S}_{\text{R}}}{{S}_{P}}\right)}^{0.25},$$

where the subscript `P`

refers to the inlet
of the connecting pipe.

The causes of those pressure losses incurred in the passages of the valve are ignored in the block. Whatever their natures—sudden area changes, flow passage contortions—only their cumulative effect is considered during simulation. This effect is assumed to reflect entirely in the sonic conductance of the valve (or in the data of the alternate valve parameterizations).

When the flow is choked, the mass flow rate is a function of the sonic conductance of the valve and of the thermodynamic conditions (pressure and temperature) established at the inlet. The function is linear with respect to pressure:

$${\dot{m}}_{\text{ch}}=C{\rho}_{\text{0}}{p}_{\text{in}}\sqrt{\frac{{T}_{\text{0}}}{{T}_{\text{in}}}},$$

where:

*C*is the sonic conductance inside the valve. Its value is obtained from the block parameter of the same name or by conversion of other block parameters (the exact source depending on the**Valve parameterization**setting).*ρ*is the gas density, here at standard conditions (subscript`0`

), obtained from the**Reference density**block parameter.*p*is the absolute gas pressure, here corresponding to the inlet (`in`

).*T*is the gas temperature at the inlet (`in`

) or at standard conditions (`0`

), the latter obtained from the**Reference temperature**block parameter.

When the flow is subsonic, and therefore no longer choked, the mass flow rate becomes a nonlinear function of pressure—both that at the inlet as well as the reduced value at the outlet. In the turbulent flow regime (with the outlet pressure contained in the back-pressure ratio of the valve), the mass flow rate expression is:

$${\dot{m}}_{\text{tur}}=C{\rho}_{\text{0}}{p}_{\text{in}}\sqrt{\frac{{T}_{\text{0}}}{{T}_{\text{in}}}}{\left[1-{\left(\frac{{p}_{\text{r}}-{b}_{\text{cr}}}{1-{b}_{\text{cr}}}\right)}^{2}\right]}^{m},$$

where:

*p*_{r}is the back-pressure ratio, or that between the outlet pressure (*p*_{out}) and the inlet pressure (*p*_{in}):$${P}_{\text{r}}=\frac{{p}_{\text{out}}}{{p}_{\text{in}}}$$

*b*_{cr}is the critical pressure ratio at which the flow becomes choked. Its value is obtained from the block parameter of the same name or by conversion of other block parameters (the exact source depending on the**Valve parameterization**setting).*m*is the*subsonic index*, an empirical coefficient used to more accurately characterize the behavior of subsonic flows. Its value is obtained from the block parameter of the same name or by conversion of other block parameters (the exact source depending on the**Valve parameterization**setting).

When the flow is laminar (and still subsonic), the mass flow rate expression changes to:

$${\dot{m}}_{\text{lam}}=C{\rho}_{\text{0}}{p}_{\text{in}}\left[\frac{1-{p}_{\text{r}}}{1-{b}_{\text{lam}}}\right]\sqrt{\frac{{T}_{\text{0}}}{{T}_{\text{in}}}}{\left[1-{\left(\frac{{b}_{\text{lam}}-{b}_{\text{cr}}}{1-{b}_{\text{cr}}}\right)}^{2}\right]}^{m}$$

where *b*_{lam} is the
critical pressure ratio at which the flow transitions between laminar and
turbulent regimes (obtained from the **Laminar flow pressure
ratio** block parameter). Combining the mass flow rate expressions
into a single (piecewise) function, gives:

$$\dot{m}=\{\begin{array}{ll}{\dot{m}}_{\text{lam}},\hfill & {b}_{\text{lam}}\le {p}_{\text{r}}<1\hfill \\ {\dot{m}}_{\text{tur}},\hfill & {b}_{\text{cr}}\le {p}_{\text{r}}<{p}_{\text{lam}}\hfill \\ {\dot{m}}_{\text{ch}},\hfill & {p}_{\text{r}}<{b}_{\text{Cr}}\hfill \end{array},$$

with the top row corresponding to subsonic and laminar flow, the middle row to subsonic and turbulent flow, and the bottom row to choked (and therefore sonic) flow.

The volume of fluid inside the valve, and therefore the mass of the same, is assumed to be very small and it is, for modeling purposes, ignored. As a result, no amount of gas can accumulate there. By the principle of conservation of mass, the mass flow rate into the valve through one port must therefore equal that out of the valve through the other port:

$${\dot{m}}_{A}+{\dot{m}}_{B}=0,$$

where $$\dot{m}$$ is defined as the mass flow rate *into* the
valve through port **A** or **B**. Note that in
this block the flow can reach but not exceed sonic speeds.

The valve is modeled as an adiabatic component. No heat exchange can occur between
the gas and the wall that surrounds it. No work is done on or by the gas as it
traverses from inlet to outlet. With these assumptions, energy can flow by advection
only, through ports **A** and **B**. By the
principle of conservation of energy, the sum of the port energy flows must then
always equal zero:

$${\varphi}_{\text{A}}+{\varphi}_{\text{B}}=0,$$

where *ϕ* is defined as the energy flow rate
*into* the valve through one of the ports
(**A** or **B**).