Model a Refrigeration Cycle
This topic describes a general process for creating a closed-loop refrigeration cycle model, using the Refrigeration Cycle (Air Conditioning) example as a guide. A refrigeration cycle exposes a fixed volume of refrigerant to large amounts of thermal energy that results in large and rapid density fluctuations. When simulating these conditions, an imbalance in net energy flow and poorly tuned model components can cause the system to diverge. The pressure will either continue rising due to excessive heat, or it will continue falling due to insufficient heat. Both cases result in an assert. Subsequently, these models can be challenging to create from a blank canvas. You should be familiar with basic operations in Simscape™ Fluids™ and the processes involved in the refrigeration cycle to complete the steps in the tutorial.
To build your refrigeration cycle, you will model each component within a test harness. Once your verify the response of each component, you can then begin integrating the components into an open loop system. Finally, you will close the loop. Each step includes a corresponding model that you can use as an example to complete that step. Test each piece at the desired steady-state nominal conditions to make sure it is stable and the results are what you expect before moving on to the next component.
sscfluids_refrigeration model demonstrates further refinement to
the models from this topic:
A house thermal network to the moist air network at the evaporator.
A Fan (MA) in place of the Mass Flow Rate Source (MA) block.
A controller to turn the system on and off to maintain a given indoor temperature.
After checking that the nominal steady-state simulation behaves as expected, you can investigate system performance at other off-design operating conditions by varying the parameters in the Reservoir (MA) blocks that represent the indoor and out outdoor environments. The nominal parameters in the model component blocks should remain the same as they represent the nominal sizing of the component. Avoid modifying parameters such as Nominal mass flow rate, Nominal pressure drop, and Nominal inlet pressure. when investigating off-design conditions.
Step 1: Determine the Pressure-Enthalpy Diagram
To define the parameters for each component, you need to decide where the cycle operates on the pressure-enthalpy diagram.
Determine the expected nominal operating conditions for the system based on your design requirement. Examples of significant values include nominal cooling capacity, typical outdoor temperature, and typical indoor temperature.
The model for this topic uses an ambient temperature of 30°C, and the goal is to design a refrigeration system capable of achieving a 22°C indoor temperature in a 200 m2 area within a house using approximately 4.5 tons of refrigeration, or about 16 kW of cooling energy.
Select the location of the four points of the refrigeration cycle on a PH diagram based on the refrigerant specifications. The refrigerant should be appropriate for the expected indoor and outdoor temperature range.
To conveniently plot fluid property contours, you can right-click on a Two-Phase Fluid Predefined Properties (2P) block or a Two-Phase Fluid Predefined Properties (2P) block. Use the Enthalpy Axis option to create a pressure-enthalpy diagram.
You can use data tips to read pressure, specific enthalpy, and temperature contour values at various locations of the plot to help you decide on the location of the four points of the refrigeration cycle. The example model uses R-410a.
Set the condensing temperature, or the saturation temperature in the condenser, to be marginally higher than the outdoor temperature to enable heat transfer from the refrigerant to the outdoor environment.
The example model uses a 45°C refrigerant temperature to interact with the 30°C ambient air, providing a 15°C temperature difference. This saturation temperature corresponds to a pressure of 2.734 MPa, which will be the high-pressure line in the cycle.
Set the evaporating temperature, or the saturation temperature in the evaporator, to be marginally lower than the desired indoor temperature to enable heat transfer from the indoor air to the refrigerant.
The model for this topic uses a 5°C refrigerant temperature to interact with the 22°C house temperature. This saturation temperature corresponds to a pressure of 0.934 MPa, which will be the low-pressure line in the cycle.
To estimate the specific enthalpy end points of the high and low pressure lines in the cycle, determine the temperature of the subcooling at the condenser outlet. Typically, this value is 5°C.
Compile this information to find estimates for the four points of the PH diagram. The example model uses these values:
Location Point Number Specific Pressure (p) Specific Enthalpy (h) Notes Evaporator outlet 1 0.934 MPa 430 kJ/kg Corresponds to a superheat of 5° C Condenser inlet 2 2.734 MPa 457 kJ/kg Corresponds to an estimated temperature of 65° C Condenser outlet 3 2.734 MPa 267 kJ/kg Corresponds to a subcooling of 5° C Evaporator inlet 4 0.934 MPa 267 kJ/kg Corresponds to a vapor quality of 0.27
You can iterate on these points as you develop the model and gain more information.
Draw the four points onto the refrigerant PH plot by entering:
hold on plot([430 457 267 267 430], [0.934 2.734 2.734 0.934 0.934], 'k-o', 'LineWidth', 2)
Instead of using data tips , you can create a simple model with a reservoir and the desired sensor blocks.
There is no flow to or from the reservoir, so sensor blocks measure fluid property values in the reservoir
Adjust the reservoir conditions as needed to get fluid property values at different conditions from the sensors
You can open an example simple model this configuration:
Step 2: Set Up the Evaporator Test Harness
Next, use a System-Level Condenser Evaporator (2P-MA) block to represent the evaporator cycling the volume of air within the house. Build the test harness around this block. Model the test harness for the evaporator using the Reservoir (2P) and Reservoir (MA) blocks to represent the boundary conditions. Parameterize these blocks using the values you chose in step 1.
If you are considering using the Condenser Evaporator (2P-MA) block rather than the System-Level Condenser Evaporator (2P-MA) block, the best practice is to confirm that the closed-loop refrigeration cycle behaves as expected under nominal conditions with the System-Level Condenser Evaporator (2P-MA) block. Then return to the models from the earlier steps and replace the System-Level Condenser Evaporator (2P-MA) blocks with Condenser Evaporator (2P-MA) blocks. Adjust the parameters of the Condenser Evaporator (2P-MA) block until the results match those from the System-Level Condenser Evaporator (2P-MA) block models.
Add the refrigerant mass flow rate to the harness using the Mass Flow Rate Source (2P) block, and add the air mass flow rate using the Mass Flow Rate Source (MA) block. You can estimate these values now and improve them later. Set Power added to
Nonefor both blocks, because these blocks represent boundary conditions that do no work on the flow.
Run the simulation and use Simscape Results Explorer to the check results. The simulation of the test harness model should be close to steady-state, since this is how you parameterized the evaporator. Check that the simulation outputs match your expectations from step 1.
Adjust the mass flow rate on both the Mass Flow Rate Source (2P) block and the System-Level Condenser Evaporator (2P-MA) block until your model meets the desired setpoints.
Adjust the mass flow rate on the Mass Flow Rate Source (MA) block and the System-Level Condenser Evaporator (2P-MA) block until your model meets the desired setpoints.
The example model uses a volumetric flow rate of 1.2 m3/s. This flow rate corresponds to a temperature drop of about 10°C across the evaporator, where the house temperature is 22°C and the return air is 12°C.
Pick an appropriate refrigerant tube size based on the refrigerant mass flow rate.
Pick an appropriate air duct size based on the air flow rate.
The model shows an example configuration of the evaporator and test harness:
Step 3: Set Up the Thermostatic Expansion Valve Test Harness
The next objective is to control the performance of the evaporator with a thermostatic expansion valve, which meters the flow into the evaporator based on the measured superheat.
Start with the model from step 2 and replace the Mass Flow Rate Source (2P) block with the Thermostatic Expansion Valve (2P).
The sensing port S should be connected to the evaporator outlet. It measures the evaporator superheat.
Change the conditions in the Reservoir (2P) block upstream of the valve from the evaporator inlet conditions to the condenser outlet conditions, using the cycle data from step 1.
Set the Thermostatic Expansion Valve (2P) parameters based on cycle data from steps 1 and 2.
Run the model and use the Simscape Results Explorer to check the results. They should be close to the results of step 2. The steady-state value of the opening_fraction plot for this model is close to 0.7. Check that the opening fraction for your model meets your expectations based on the design requirements.
The model shows an example of a test harness for a thermostatic expansion valve:
Step 4: Set Up the Condenser Test Harness
Build the condenser test harness in the same way that you constructed the evaporator test harness in step 2. Unlike the mass flow rate sources that you used in step 2, this compressor must do work on the flow.
Model the condenser, flow, and environmental conditions. Use a System-Level Condenser Evaporator (2P-MA) to represent a condenser that rejects heat to the outdoor environment as the refrigerant flowing through it becomes superheated. Connect a Positive-Displacement Compressor (2P) block to drive the refrigerant flow through the condenser.
Specify corresponding parameters for the nominal operating condition parameters in the condenser block.
Use Reservoir (MA) blocks to set up boundary conditions for the external environment. Set the air flow rate with Mass Flow Rate (MA) block.
Specify the Positive-Displacement Compressor (2P) block parameters based on the nominal operating conditions using the cycle data from step 1. You can set Displacement specification to
Nominal mass flow rate and shaft speed. Then you can use the value that you chose in step 2 for the Nominal mass flow rate parameter. The example model uses
In a refrigeration cycle, the compressor drives refrigerant flow leaving the evaporator and sends it to the condenser. As it does work on the flow, it increases the thermal load on the condenser. Since this portion of the model includes the compressor, you can use the Positive-Displacement Compressor (2P) block instead of the Mass Flow Rate Source (2P) block from step 2.
As a simpler alternative, you may use a Mass Flow Rate Source (2P) block and set Power added to
Isentropicto represent the compressor. You should switch to the Positive-Displacement Compressor (2P) block prior to closing the loop in step 6, because a compressor provides more stability to the closed loop system. This is because the flow rate will vary in response to the pressure difference between the high-pressure line and the low-pressure line, which provides flexibility to the system. In contrast, a mass flow rate source produces an idealized constant mass flow rate regardless of fluctuations in operating conditions.
Run the model and use the Simscape Results Explorer to check the results. Check the temperatures of the Thermodynamic Properties Sensor (2P) blocks at the condenser inlet and evaporator outlet. Since the compressor does work on the refrigerant, the inlet temperature should be higher than the outlet.
Adjust the Nominal inlet temperature parameter in the System-Level Heat Exchanger (2P) block accordingly. Note that the condenser inlet and outlet specific enthalpy match the specific enthalpy end points of the high and low pressure lines in the cycle on the PH-diagram from step 1.
Since the boundary conditions in the reservoir match the nominal operating conditions in the System-Level Heat Exchanger (2P-MA) block, and since the initial conditions of the System-Level Heat Exchanger (2P-MA) are the same as the nominal operating conditions, the simulation of the test harness model should be close to steady-state.
Check that the rate of heat transfer in the condenser is approximately equal to the combined rate of heat transfer in the evaporator from step 3 and the fluid power in the compressor. This is important to ensure that the closed loop system will have negligible net energy transfer, so as to prevent pressure divergence.
Adjust the air mass flow rate on both the Mass Flow Rate Source (MA) block and the System-Level Condenser Evaporator (2P-MA) block parameters to safely reject heat from the condenser. The example model uses a volumetric flow rate of 1.5 m3/s. This results in an air temperature rise of about 10°C across the condenser, from 30°C to 40°C.
The model shows an example configuration of the condenser and compressor in a test harness:
Step 5: Create a Model of the Open-Loop System
Create a model with all components in the system.
Use a Receiver Accumulator (2P) block to connect the condenser outlet from step 4 with the Thermostatic Expansion Valve (2P) block inlet from step 3.
Keep the evaporator block outlet and the compressor inlet disconnected for this step so that the model remains an open loop.
Both Reservoir (2P) blocks should match the boundary conditions of the evaporator outlet, based on the cycle data from step 1. This serves as a final test before closing the loop of the refrigeration cycle.
The Receiver Accumulator (2P) block provides stability to the closed loop system in the next step because it models a large volume of refrigerant where the liquid level can rise and fall in response to fluctuating operating conditions.
The volume depends the size of the refrigeration system. Because this model is open loop, the flow rate through the condenser may not exactly match the flow rate through the evaporator, which causes the liquid level in the Receiver Accumulator (2P) block to rise and fall over time. This is acceptable for the test as long as the level does not change rapidly.
Run the model and use Simscape Results Explorer to check the results. The results should be close the results from step 3 and step 4.
The model shows an example open-loop refrigeration system configuration:
Step 6: Close the Loop
You are now ready to remove the reservoirs and connect the evaporator to the compressor.
Remove the reservoirs from step 5 and connect the evaporator outlet to the compressor inlet.
Run the model and use the Simscape Results Explorer to check your results. They should be close to the results from step 5.
If the pressure keeps increasing or keeps decreasing, then it is likely because the condenser heat transfer does not match the combined evaporator heat transfer and compressor fluid power, resulting in a net energy transfer to or from the refrigerant. Return to your harness from step 4.
Check that the liquid level in the Receiver Accumulator is stable at the steady-state nominal operating condition and adjust its volume if necessary
Check that the refrigerant mass flow rate, evaporator pressure, and condenser pressure are stable at the steady-state nominal operating conditions. If the condenser heat transfer does not match the evaporator heat transfer plus the compressor fluid power, the pressure may continue rising or continue falling during the simulation.
Check that the liquid level in the Receiver Accumulator (2P) block is stable at the steady-state nominal operating condition, and adjust its volume if necessary.
The model shows an example closed-loop configuration.: