# System-Level Refrigeration Cycle (2P)

System-level, two-phase refrigeration block in a moist air, thermal liquid, or two-phase fluid network

*Since R2023a*

**Libraries:**

Simscape /
Fluids /
Two-Phase Fluid /
Thermodynamic Cycles

## Description

The System-Level Refrigeration Cycle (2P) block models a
basic refrigeration cycle consisting of a compressor, a condenser, a liquid receiver, a
thermostatic expansion valve, and an evaporator. The block models the refrigerant loop
within the block in the two-phase fluid domain using the fluid properties specified at
port **F**. The condenser and evaporator external fluids can be part of
a moist air, thermal liquid, or two-phase fluid network. The external fluids are the
fluids in the condenser and evaporator opposite the refrigerant.

When the compressor is on, the refrigeration cycle consumes power to transfer heat from the evaporator external fluid to the condenser external fluid. The subcomponents provide the specified nominal heat transfer under nominal operating conditions.

### Block Structure

This block behaves as a simplified version of this refrigeration cycle made from Simscape™ Fluids™ blocks that model the condenser, compressor, evaporator, expansion device, and liquid receiver:

The refrigerant flows through the loop counterclockwise. The compressor, which is
controlled by the signal at port **S**, sucks in refrigerant vapor
and produces a hot, high-pressure vapor, which moves to the condenser. The condenser
rejects heat from the refrigerant to the external fluid to condense the refrigerant.
The liquid receiver acts as a storage tank for the refrigerant and only allows
liquid flow to exit, which helps maintain normal operation even if fluctuating
external conditions cause the condenser output to vary. From the tank, the
refrigerant flows to the expansion device, which is typically a valve or capillary
tube that produces a large pressure loss. The drop in pressure partially vaporizes
the refrigerant, which chills it. The refrigerant moves to the evaporator, which
absorbs heat from the external fluid to the cold refrigerant to vaporize the
refrigerant.

The subcomponents of the System-Level Refrigeration Cycle (2P) block behave the same as these Simscape Fluids blocks in this model, but the equations for the positive displacement compressor, expansion valve, receiver component, and condenser and evaporator subcomponents vary. For more information on the individual components of a refrigeration system, see:

The compressor and evaporator components depend on the **External fluid
for condenser heat transfer** and **External fluid for
evaporator heat transfer** parameters. For more information, see:

**Positive Displacement Compressor Subcomponent**

The compressor subcomponent determines the refrigerant mass flow rate for the system. The
physical signal input port **S** controls the compressor
operation. When the value at port **S** is
`0`

, the compressor is off and the mass flow rate is
`0`

. When the value at port **S** is
`1`

, the compressor runs at the nominal shaft speed, which
produces the nominal mass flow rate under nominal operating conditions. To
prevent reverse flow, the value of **S** must be greater than
or equal to `0`

.

The mass flow rate in the compressor is

$$\dot{m}=\frac{{\eta}_{v}{\dot{V}}_{nominal}S}{{v}_{in}},$$

where:

*η*is the volumetric efficiency._{v}*S*is the value of the signal at port**S**.*v*is the inlet specific volume._{in}$${\dot{V}}_{nominal}$$ is the nominal volumetric flow rate, which the block determines from the nominal mass flow rate, $${\dot{m}}_{nominal}$$, which depends on the setting of the

**Capacity specification**parameter:When the

**Capacity specification**parameter is`Cooling load`

,$${\dot{m}}_{nominal}=\frac{{Q}_{cooling}}{{h}_{1}-{h}_{4}},$$

where

*Q*is the_{cooling}**Nominal evaporator heat transfer**parameter,*h*is the evaporator outlet specific enthalpy, and_{1}*h*is the valve outlet specific enthalpy._{4}When the

**Capacity specification**parameter is`Heating load`

,$${\dot{m}}_{nominal}=\frac{{Q}_{heating}}{{h}_{2}-{h}_{3}},$$

where

*Q*is the_{cooling}**Nominal condenser heat transfer**parameter,*h*is the compressor outlet specific enthalpy, and_{2}*h*is the condenser outlet specific enthalpy._{3}When the

**Capacity specification**parameter is`Refrigerant mass flow rate`

, $${\dot{m}}_{nominal}$$ is the value of the**Nominal mass flow rate**parameter.

The fluid power that the compressor adds to the flow is

$${\Phi}_{fluid}=\dot{m}\frac{{h}_{out,isen}-{h}_{in}}{{\eta}_{s}},$$

where:

*h*is the specific enthalpy evaluated at the output pressure for an isentropic process._{out,isem}*h*is the inlet specific enthalpy._{in}*η*is the isentropic efficiency._{s}When

**Performance specification**is`Coefficient of performance for cooling`

or`Coefficient of performance for heating`

, the block solves for*η*by calculating_{s}*h*and using the relation_{2}$${\text{h}}_{2}=\frac{{h}_{2}^{isen}-{h}_{1}}{{\eta}_{s}}+{h}_{1},$$

where

*h*is the compressor outlet specific enthalpy assuming an isentropic process._{2}^{isen}When

**Performance specification**is`Coefficient of performance for cooling`

, the block solves for*h*with $${\text{CoP}}_{cooling}=\frac{{h}_{1}-{h}_{4}}{{h}_{2}-{h}_{1}},$$ where_{2}*CoP*is the_{cooling}**Coefficient of performance at nominal conditions**parameter.When

**Performance specification**is`Coefficient of performance for heating`

, the block solves for*h*with $$Co{P}_{heating}=\frac{{h}_{2}-{h}_{3}}{{h}_{2}-{h}_{1}}=\frac{{h}_{2}-{h}_{4}}{{h}_{2}-{h}_{1}}=Co{P}_{cooling}+1,$$ where_{2}*CoP*is the_{heating}**Coefficient of performance at nominal conditions**parameter.

When

**Performance specification**is`Compressor isentropic efficiency`

,*η*is the value of the_{s}**Compressor isentropic efficiency**parameter.

The block calculates the volumetric efficiency directly from the inlet and outlet specific volumes

$${\eta}_{v}=1+C-C\frac{{v}_{in}}{{v}_{out}},$$

where:

*C*is the clearance volume fraction that the block determines from the nominal operating conditions.*v*and_{in}*v*are the inlet and outlet specific volumes evaluated at the inlet and outlet pressures._{out}

The compressor subcomponent does not have mechanical rotational ports and does not need to calculate shaft torque. The mechanical power is

$${\Phi}_{mech}=\frac{{\Phi}_{fluid}}{{\eta}_{m}},$$

where *η _{m}* is the mechanical
efficiency.

**Expansion Valve Subcomponent**

The relationship between mass flow rate, which the compressor determines, and the pressure drop across the thermostatic expansion valve subcomponent is

$$\dot{m}={S}_{eff}\sqrt{\frac{2}{{v}_{in}}}\frac{\Delta p}{{\left(\Delta {p}^{2}-\Delta {p}_{lam}^{2}\right)}^{0.25}},$$

where:

*v*is the inlet specific volume._{in}*Δp*is the pressure differential over the valve.*Δp*is the pressure threshold for transitional flow. Below this value, the flow is laminar._{lam}

The effective valve area depends on the pressure difference
between the measured pressure, *p _{bulb}*,
and the equalization pressure,

*p*

_{eq}$${S}_{eff}=\beta \left[\left({p}_{bulb}-{p}_{eq}\right)-\left({p}_{sat}\left({T}_{evap}+\Delta {T}_{static}\right)-{p}_{sat}\left({T}_{evap}\right)\right)\right],$$

where:

*β*is a valve constant the block determines from the nominal operating conditions.*T*is the evaporating temperature, which depends on the_{evap}**Pressure specification**setting:When

**Pressure specification**is`Pressure at specified saturation temperature`

,*T*is the value of the_{evap}**Nominal evaporating (saturation) temperature**parameter.When

**Pressure specification**is`Specified pressure`

,*T*is the saturation temperature that corresponds to the value of the_{evap}**Nominal evaporator pressure**parameter.

*ΔT*is the_{static}**Static (minimum) evaporator superheat**parameter.*p*is the fluid saturation pressure as a function of_{sat}(T_{evap})*T*._{evap}*p*is the fluid saturation pressure as a function of_{sat}(T_{evap}+ΔT_{static})*T*._{evap}+ΔT_{static}*p*is the fluid pressure of the bulb. This pressure is the saturation pressure at the evaporator outlet temperature._{bulb}*p*is the equalization pressure, which is the evaporator pressure for this block._{eq}

The effective valve area has limits. The minimum effective valve
area, *S _{eff,min}*, is

$${S}_{eff,\mathrm{min}}={f}_{leak}{S}_{eff,nom},$$

where *f _{leak}* is the
value of the

**Ratio of leakage to nominal expansion valve opening**parameter. The maximum effective valve area,

*S*, is

_{eff,mmax}$${S}_{eff,max}={f}_{max}{S}_{eff,nom},$$

where *f _{max}* is the
value of the

**Ratio of maximum to nominal expansion valve opening**parameter.

**Receiver Subcomponent**

Excluding the receiver, the block assumes that the refrigerant mass flow rate is the same value through the loop. In the receiver, the total mass is based on the balance between the mass flow rate produced by the compressor and the mass flow rate metered by the expansion valve. The outflow from the receiver subcomponent is always liquid and perfectly insulated from the environment.

The liquid mass fraction in the receiver subcomponent is

$$\text{M}\frac{d{x}_{liq}}{dt}={\dot{m}}_{liq,in}-{\dot{m}}_{out}-{\dot{m}}_{vaporization}+{\dot{m}}_{condensation},$$

where:

*x*is the liquid mass fraction._{liq}$$\dot{m}$$

_{liq,in}is the portion of the flow in that is liquid.$$\dot{m}$$

_{out}is the mass flow rate out of the receiver.$$\dot{m}$$

_{vaporization }is the rate of vaporization from the liquid volume to the vapor volume.$$\dot{m}$$

_{condensation}is the rate of condensation from the vapor volume to the liquid volume.

The pressure relates to the total mass via the specific volume using the relation

$$\text{M}\left({x}_{liq}{v}_{liq}+\left(1-{x}_{liq}\right){v}_{vap}\right)=V,$$

where:

*V*is the total receiver volume.*v*is the is the specific volume of the liquid volume._{liq}*v*is the is the specific volume of the vapor volume._{vap}

**Condenser and Evaporator Subcomponents**

The condenser and evaporator subcomponents model the refrigerant thermal mass, but do not model fluid volume. For the condenser and evaporator, the energy conservation equation is

$$\text{M}\frac{d{h}_{I}}{dt}=\dot{m}\left({h}_{in}-{h}_{out}\right)+Q,$$

where:

*M*is the constant mass of refrigerant in the component.*h*is the refrigerant specific enthalpy at the component internal node._{I}$$\dot{m}$$ is the refrigerant mass flow rate.

*Q*is the rate of heat transfer from the external fluid to the refrigerant.*h*and_{in}*h*are the refrigerant specific enthalpy in and out of the component._{out}

### Visualize the P-H Diagram

To visualize the refrigeration cycle, use a Probe block from the Simscape > Utilities library to output the
variables `p_cycle`

and `h_cycle`

. These variables
contain the four pressure and specific enthalpy points of the refrigeration cycle.
Connect the variables to the P-H Diagram
(2P) block to visualize the refrigeration cycle.

This diagram shows the fluid attributes throughout the system for the refrigerant R-410a. Segment 1 to 2 is the compressor, segment 2 to 3 is the condenser, point 3 is the receiver, segment 3 to 4 is the expansion valve, and segment 4 to 1 is the evaporator.

### Assumptions and Limitations

The block does not model reverse flow and limits the refrigeration cycle to zero and forward flow only. To prevent reverse flow, the block limits the compressor control to zero or forward operation and only models fluid volume in the liquid receiver subcomponent.

Excluding the liquid receiver, the subcomponents do not model refrigerant fluid volume, which prevents the accumulation of mass in subcomponents. As a result, the refrigerant mass flow rate is the same through the evaporator, compressor, and condenser subcomponents.

There is no refrigerant pressure loss in the evaporator or condenser.

The block does not model kinetic energy changes in the refrigerant flow.

The evaporator subcomponent models approximate pressure dynamics to maintain numerical robustness. However, the condenser subcomponent does not model approximate pressure dynamics, because the condenser pressure is equal to the receiver pressure, which does model pressure dynamics.

The condenser and evaporator subcomponents only model counter flow because the refrigerant is primarily in the two-phase mixture state within the condenser and evaporator. Consequently, the temperature is uniform across most of the condenser and evaporator, and there is no significant difference between counter flow and cross flow.

## Examples

## Ports

### Input

### Conserving

### Output

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2023a**