# Ball Valve (G)

**Libraries:**

Simscape /
Fluids /
Gas /
Valves & Orifices /
Flow Control Valves

## Description

The Ball Valve (G) block models flow through a ball valve in
a gas network. A rotating ball with a central hole, or bore, controls the flow of the
valve. When the bore aligns with the valve inlet and outlet the valve is open. The
physical signal at port **S** controls the ball rotation.

### Valve Parameterizations

The block behavior depends on the **Valve parametrization**
parameter:

`Cv flow coefficient`

— The flow coefficient*C*_{v}determines the block parameterization. The flow coefficient measures the ease with which a gas flows when driven by a certain pressure differential.`Kv flow coefficient`

— The flow coefficient*K*_{v}, where $${K}_{v}=0.865{C}_{v}$$, determines the block parameterization. The flow coefficient measures the ease with which a gas flows when driven by a certain pressure differential.`Sonic conductance`

— The sonic conductance of the resistive element at steady state determines the block parameterization. The sonic conductance measures the ease with which a gas flows when*choked*, which is a condition in which the flow velocity is at the local speed of sound. Choking occurs when the ratio between downstream and upstream pressures reaches a critical value known as the*critical pressure ratio*.`Orifice area`

— The size of the flow restriction determines the block parametrization.

### Opening Area

The block calculates the ball valve opening during simulation from the input at
port **S**. The opening area calculations depend on the
**Opening Characteristic** parameter.

**Area of Overlapping Circles**

If you set **Opening Characteristic** to ```
Area of overlapping
circles
```

, the block calculates the opening area of the valve by
assuming that the valve port and the ball bore are overlapping circles. The open
area saturates when the input signal from port **S** goes
outside the range of 0 rad to π/2 rad.

The block calculates the opening area as

$$\begin{array}{l}{A}_{open}=\mathrm{sin}\left(\phi \right){R}_{bore}^{2}\left[{\mathrm{cos}}^{-1}\left({\lambda}_{bore}\right)-{\lambda}_{bore}\sqrt{1-{\lambda}_{bore}}\right]+{R}_{port}^{2}\left[{\mathrm{cos}}^{-1}\left({\lambda}_{port}\right)-{\lambda}_{port}\sqrt{1-{\lambda}_{port}}\right]\\ {\lambda}_{bore}=\frac{{R}_{bore}^{2}-{R}_{port}^{2}+{l}^{2}}{2{R}_{bore}l}\\ {\lambda}_{port}=\frac{{R}_{port}^{2}-{R}_{bore}^{2}+{l}^{2}}{2{R}_{port}l}\end{array}$$

where:

*R*and_{port}*R*are the radii of the valve port and the ball bore, respectively._{bore}*l*is the displacement of the bore center from the valve port center.*φ*is the rotation of the ball valve given by the physical signal**S**. The valve is fully shut at 0 rad and fully open at π/2 rad.

**Tabulated area**

If you set **Opening Characteristic** to ```
Tabulated
data
```

, the block interpolates the valve opening from the
**Area vector**, **Cv flow coefficient
vector**, **Kv flow coefficient vector**, or
**Sonic conductance vector** parameters. The elements in
these vectors correspond one-to-one to the elements in the **Ball
rotation vector** parameter. The block interpolates between the
data points with linear interpolation and uses nearest extrapolation for points
beyond the table boundaries.

### Momentum Balance

The block equations depend on the **Valve parametrization**
parameter. When you set **Valve parametrization** to
`Cv flow coefficient`

, the mass flow rate, $$\dot{m}$$, is

$$\dot{m}={C}_{v}\frac{{S}_{open}}{{S}_{Max}}{N}_{6}Y\sqrt{({p}_{in}-{p}_{out}){\rho}_{in}},$$

where:

*C*is the value of the_{v}**Maximum Cv flow coefficient**parameter.*S*is the valve opening area._{open}*S*is the maximum valve area when the valve is fully open._{Max}*N*is a constant equal to 27.3 for mass flow rate in kg/hr, pressure in bar, and density in kg/m_{6}^{3}.*Y*is the expansion factor.*p*is the inlet pressure._{in}*p*is the outlet pressure._{out}*ρ*is the inlet density._{in}

The expansion factor is

$$Y=1-\frac{{p}_{in}-{p}_{out}}{3{p}_{in}{F}_{\gamma}{x}_{T}},$$

where:

*F*is the ratio of the isentropic exponent to 1.4._{γ}*x*is the value of the_{T}**xT pressure differential ratio factor at choked flow**parameter.

The block smoothly transitions to a linearized form of the equation when the
pressure ratio, $${p}_{out}/{p}_{in}$$, rises above the value of the **Laminar flow pressure
ratio** parameter,
*B _{lam}*,

$$\dot{m}={C}_{v}\frac{{S}_{open}}{{S}_{Max}}{N}_{6}{Y}_{lam}\sqrt{\frac{{\rho}_{avg}}{{p}_{avg}(1-{B}_{lam})}}({p}_{in}-{p}_{out}),$$

where:

$${Y}_{lam}=1-\frac{1-{B}_{lam}}{3{F}_{\gamma}{x}_{T}}.$$

When the pressure ratio, $${p}_{out}/{p}_{in}$$, falls below $$1-{F}_{\gamma}{x}_{T}$$, the orifice becomes choked and the block switches to the equation

$$\dot{m}=\frac{2}{3}{C}_{v}\frac{{S}_{open}}{{S}_{Max}}{N}_{6}\sqrt{{F}_{\gamma}{x}_{T}{p}_{in}{\rho}_{in}}.$$

When you set **Valve parametrization** to ```
Kv
flow coefficient
```

, the block uses these same equations, but
replaces *C _{v}* with

*K*by using the relation $${K}_{v}=0.865{C}_{v}$$. For more information on the mass flow equations when the

_{v}**Valve parametrization**parameter is

```
Kv flow
coefficient
```

or `Cv flow coefficient`

,
[2][3].When you set **Valve parametrization** to ```
Sonic
conductance
```

, the mass flow rate, $$\dot{m}$$, is

$$\dot{m}=C\frac{{S}_{open}}{{S}_{Max}}{\rho}_{ref}{p}_{in}\sqrt{\frac{{T}_{ref}}{{T}_{in}}}{\left[1-{\left(\frac{\frac{{p}_{out}}{{p}_{in}}-{B}_{crit}}{1-{B}_{crit}}\right)}^{2}\right]}^{m},$$

where:

*C*is the value of the**Maximum sonic conductance**parameter.*B*is the critical pressure ratio._{crit}*m*is the value of the**Subsonic index**parameter.*T*is the value of the_{ref}**ISO reference temperature**parameter.*ρ*is the value of the_{ref}**ISO reference density**parameter.*T*is the inlet temperature._{in}

The block smoothly transitions to a linearized form of the equation when the
pressure ratio, $${p}_{out}/{p}_{in}$$, rises above the value of the **Laminar flow pressure
ratio** parameter
*B _{lam}*,

$$\dot{m}=C\frac{{S}_{open}}{{S}_{Max}}{\rho}_{ref}\sqrt{\frac{{T}_{ref}}{{T}_{avg}}}{\left[1-{\left(\frac{{B}_{lam}-{B}_{crit}}{1-{B}_{crit}}\right)}^{2}\right]}^{m}\left(\frac{{p}_{in}-{p}_{out}}{1-{B}_{lam}}\right).$$

When the pressure ratio, $${p}_{out}/{p}_{in}$$, falls below the critical pressure ratio,
*B _{crit}*, the orifice becomes
choked and the block switches to the equation

$$\dot{m}=C\frac{{S}_{open}}{{S}_{Max}}{\rho}_{ref}{p}_{in}\sqrt{\frac{{T}_{ref}}{{T}_{in}}}.$$

For more information on the mass flow equations when the **Valve
parametrization** parameter is ```
Sonic
conductance
```

, see [1].

When you set **Valve parametrization** to
`Orifice area based on geometry`

, the mass flow
rate, $$\dot{m}$$, is

$$\dot{m}={C}_{d}{S}_{open}\sqrt{\frac{2\gamma}{\gamma -1}{p}_{in}{\rho}_{in}{\left(\frac{{p}_{out}}{{p}_{in}}\right)}^{\frac{2}{\gamma}}\left[\frac{1-{\left(\frac{{p}_{out}}{{p}_{in}}\right)}^{\frac{\gamma -1}{\gamma}}}{1-{\left(\frac{{S}_{open}}{S}\right)}^{2}{\left(\frac{{p}_{out}}{{p}_{in}}\right)}^{\frac{2}{\gamma}}}\right]},$$

where:

*S*is the valve opening area._{open}*S*is the value of the**Cross-sectional area at ports A and B**parameter.*C*is the value of the_{d}**Discharge coefficient**parameter.*γ*is the isentropic exponent.

The block smoothly transitions to a linearized form of the equation when the
pressure ratio, $${p}_{out}/{p}_{in}$$, rises above the value of the **Laminar flow pressure
ratio** parameter,
*B _{lam}*,

$$\dot{m}={C}_{d}{S}_{open}\sqrt{\frac{2\gamma}{\gamma -1}{p}_{avg}^{\frac{2-\gamma}{\gamma}}{\rho}_{avg}{B}_{lam}^{\frac{2}{\gamma}}\left[\frac{1-\text{\hspace{0.17em}}{B}_{lam}^{\frac{\gamma -1}{\gamma}}}{1-{\left(\frac{{S}_{open}}{S}\right)}^{2}{B}_{lam}^{\frac{2}{\gamma}}}\right]}\left(\frac{{p}_{in}^{\frac{\gamma -1}{\gamma}}-{p}_{out}^{\frac{\gamma -1}{\gamma}}}{1-{B}_{lam}^{\frac{\gamma -1}{\gamma}}}\right).$$

When the pressure ratio, $${p}_{out}/{p}_{in}$$, falls below$${\left(\frac{2}{\gamma +1}\right)}^{\frac{\gamma}{\gamma -1}}$$ , the orifice becomes choked and the block switches to the equation

$$\dot{m}={C}_{d}{S}_{open}\sqrt{\frac{2\gamma}{\gamma +1}{p}_{in}{\rho}_{in}\frac{1}{{\left(\frac{\gamma +1}{2}\right)}^{\frac{2}{\gamma -1}}-{\left(\frac{{S}_{open}}{S}\right)}^{2}}}.$$

For more information on the mass flow equations when the **Valve
parametrization** parameter is ```
Orifice area based on
geometry
```

, see [4].

### Mass Balance

The block assumes the volume and mass of fluid inside the valve is very small and ignores these values. As a result, no amount of fluid can accumulate in the valve. By the principle of conservation of mass, the mass flow rate into the valve through one port equals 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 the port
indicated by the **A** or **B** subscript.

### Energy Balance

The resistive element of the block is an adiabatic component. No heat exchange can
occur between the fluid and the wall that surrounds it. No work is done on or by the
fluid as it traverses from inlet to outlet. Energy can flow only by advection,
through ports **A** and **B**. By the principle of conservation of energy, the sum of the port
energy flows is always equal to zero

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

where *ϕ* is the energy flow rate into the valve through ports
**A** or **B**.

### Assumptions and Limitations

The

`Sonic conductance`

setting of the**Valve parameterization**parameter is for pneumatic applications. If you use this setting for gases other than air, you may need to scale the sonic conductance by the square root of the specific gravity.The equation for the

`Orifice area based on geometry`

parameterization is less accurate for gases that are far from ideal.This block does not model supersonic flow.

## Ports

### Input

### Conserving

## Parameters

## References

[1] ISO 6358-3, "Pneumatic fluid power – Determination of flow-rate characteristics of components using compressible fluids – Part 3: Method for calculating steady-state flow rate characteristics of systems", 2014.

[2] IEC 60534-2-3, “Industrial-process control valves – Part 2-3: Flow capacity – Test procedures”, 2015.

[3] ANSI/ISA-75.01.01, “Industrial-Process Control Valves – Part 2-1: Flow capacity – Sizing equations for fluid flow underinstalled conditions”, 2012.

[4] P. Beater, *Pneumatic
Drives*, Springer-Verlag Berlin Heidelberg, 2007.

## Extended Capabilities

## Version History

**Introduced in R2023b**