# Positive-Displacement Compressor (2P)

**Libraries:**

Simscape /
Fluids /
Two-Phase Fluid /
Fluid Machines

## Description

The Positive-Displacement Compressor (2P) block represents a
positive-displacement compressor, such as a reciprocating piston, rotary screw, rotary
vane, or scroll, in a two-phase fluid network. Port **R** and port
**C** are mechanical rotational conserving ports associated with
the compressor shaft and casing, respectively. When there is positive rotation at port
**R** with respect to port **C**, two-phase fluid
flows from port **A** to port **B**. The block may not
be accurate for reversed flow.

The figure shows the steps of a positive-displacement compressor on a P-V diagram, which has these states:

*a*— The compressor cylinder is full at inlet pressure.*b*— The pressure inside the compressor exceeds that of the outlet, which results in fluid discharge.*c*— The compressor reaches the top of the piston stroke, and only the clearance volume remains in the cylinder.*d*— The pressure inside the cylinder drops below the inlet pressure, which results in fluid intake.

### Mass Flow Rate

The block calculates the mass flow rate as

$$\dot{m}={\eta}_{V}\omega \frac{{V}_{disp}}{{v}_{s}},$$

where:

*ṁ*is the mass flow rate.*ω*is the angular velocity of port**R**relative to port**C**.*v*is the specific volume at the inlet. The block calculates this value based on the_{s}**Nominal conditions specification**parameter and specified nominal inlet conditions.*V*is the displacement volume that the block uses._{disp}

### Displacement Volume

When you set **Displacement specification** to ```
Volumetric
displacement
```

, the block uses the **Displacement
volume** parameter as the value for
*V _{disp}*.

When you set **Displacement specification** to
`Nominal mass flow rate and shaft speed`

, the block
calculates the displacement volume as

$${V}_{disp}=\frac{{\dot{m}}_{nominal}{v}_{s,nominal}}{{\omega}_{nominal}{\eta}_{{V}_{nominal}}},$$

where:

*ṁ*is the value of the_{nominal}**Nominal mass flow rate**parameter.*ω*is the value of the_{nominal}**Nominal shaft speed**parameter.*η*is the value of the_{Vnominal}**Nominal volumetric efficiency**parameter when the**Efficiency specification**parameter is`Analytical`

. When the**Efficiency specification**parameter is`Tabulated`

, the block uses the`tablelookup`

function to interpolate*η*as a function of the shaft speed and the pressure ratio._{Vnominal}

### Volumetric Efficiency

You can parameterize the volumetric efficiency by using analytical values or a lookup table.

**Analytical Volumetric Efficiency**

When you set **Efficiency specification** to
`Analytical`

, the block calculates the volumetric
efficiency by using analytical values. When the **Thermodynamic
model** parameter is `Polytropic`

, the
volumetric efficiency is

$${\eta}_{V}=1+C-C{\left(\frac{{p}_{out}}{{p}_{in}}\right)}^{\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$n$}\right.},$$

where *p _{in}* and

*p*are the inlet and outlet pressures, respectively, and

_{out}*n*is the value of the

**Polytropic exponent**parameter. The block calculates the clearance volume fraction,

*C*, as

$$C=\frac{1-{\eta}_{{V}_{nominal}}}{{p}_{ratio}{}^{1/n}-1},$$

where
*η _{Vnominal}*
is the value of the

**Nominal volumetric efficiency**parameter and

*p*is the value of the

_{ratio}**Nominal pressure ratio**parameter.

When the **Thermodynamic model** parameter is
`Isentropic`

, the volumetric efficiency is

$${\eta}_{V}=1+C-C\left(\frac{{v}_{in}}{{v}_{out}}\right),$$

where *v _{in}* and

*v*are the inlet and outlet specific volumes, respectively. The block calculates the clearance volume fraction,

_{out}*C*, as

$$\text{C=}\frac{1-{\eta}_{Vnominal}}{v{r}_{nominal}-1}$$

where $${\text{vr}}_{nominal}={v}_{i{n}_{nominal}}/{v}_{ou{t}_{nominal}}$$ is the nominal specific volume ratio. The block calculates
this value from the nominal inlet conditions and the isentropic efficiency
depending on the choice for the **Nominal conditions
specification** parameter.

**Tabulated Volumetric Efficiency**

When you set **Efficiency specification** to
`Tabulated`

, the block calculates the volumetric
efficiency by interpolating the values of the **Volumetric efficiency
table, eta_vol(pr,w)** parameter as a function of the shaft speed
and the pressure ratio.

### Continuity Equations

The block conserves mass such that

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

where *ṁ _{A}* and

*ṁ*are the mass flow rates at ports

_{B}**A**and

**B**, respectively. The block conserves energy such that

$${\varphi}_{A}+{\varphi}_{B}+{\dot{m}}_{A}\Delta {h}_{t}=0,$$

where *Δh _{t}* is the change
in specific total enthalpy and

*ṁ*is the fluid power, which is equal to the mechanical power,

_{A}Δh_{t}*torque*ω*.

When the **Thermodynamic model** parameter is
`Polytropic`

, the fluid power is

$${\dot{W}}_{c}=\omega \frac{n}{n-1}{\eta}_{V}{p}_{in}{V}_{disp}\left[{\left(\frac{{p}_{in}}{{p}_{out}}\right)}^{\frac{n-1}{n}}-1\right],$$

where the block uses the polytropic relationship $${\text{pv}}^{n}=\text{constant}$$ to relate *p _{in}*,

*p*,

_{out}*v*, and

_{in}*v*.

_{out}When the **Thermodynamic model** parameter is
`Isentropic`

, the fluid power is

$${\dot{W}}_{C}={\dot{m}}_{A}\Delta {h}_{t}.$$

The block calculates
*Δh _{t}* from the isentropic efficiency,

*η*. When

_{isen}**Efficiency specification**is

`Analytical`

,
*η*is equal to the value of the

_{isen}**Isentropic efficiency**parameter. When

**Efficiency specification**is

`Tabulated`

, the block
calculates *η*by interpolating the values of the

_{isen}**Isentropic efficiency table, eta_isen(pr,w)**parameter as a function of the pressure ratio and the shaft speed.

### Visualizing the Volumetric Efficiency

To visualize the block volumetric efficiency, right-click the block and select **Fluids** > **Plot Volumetric Efficiency**.

Each time you modify the block settings, click **Reload Data** in the
figure window.

When you set **Efficiency specification** to
`Analytical`

and **Thermodynamic
model** to `Polytropic`

, the block plots the
compressor volumetric efficiency against the pressure ratio.

When you set **Efficiency specification** to
`Analytical`

and **Thermodynamic
model** to `Isentropic`

, the block plots the
compressor volumetric efficiency against the pressure ratio at the block nominal
conditions.

When you set **Efficiency specification** to
`Tabulated`

, the block plots the compressor volumetric
efficiency against the pressure ratio for each element in the **Shaft speed
vector, w** parameter.

### Assumptions and Limitations

The block may not be accurate for flow from port

**B**to port**A**.The block assumes that the flow is quasi-steady. The compressor does not accumulate mass.

The block is designed to operate in superheated vapor. The block may not be accurate in two-phase mixture or subcooled liquid.

## Ports

### Conserving

## Parameters

## References

[1] Mitchell, John W., and James E.
Braun. *Principles of Heating, Ventilation, and Air Conditioning in
Buildings*. Hoboken, NJ: Wiley, 2013.

## Extended Capabilities

## Version History

**Introduced in R2022a**