A Hybrid Steady-State Compressor Model for Real-Time Applications in Performance Monitoring, Control and Optimization

In this study, a hybrid steady-state compressor model is proposed that can be used in the real-time performance monitoring, control and optimization of the vapor compression cycle. In the proposed model, first, a detailed analysis of the mass flow rate is presented, which is based on the volumetric efficiency concept and the assumption of a polytropic compression process. Then, discharge temperature of the refrigerant and power consumption of the compressor are also investigated. Three semiempirical models are constructed respectively. Further, to tune the unknown empirical parameters of the models, a social learning particle swarm optimization (SLPSO) algorithm is developed by using the real-time experimental data. An experimental apparatus of a refrigerant system is tested to validate the proposed models. The experimental results demonstrate that the proposed models accurately predict the performance of real-time operating compressors. Meanwhile, the models identified by the SLPSO algorithm are more accurate than those identified by the traditional least-squares method.


I. INTRODUCTION
Compressors are widely applied in commercial and residential air-conditioning, refrigeration and heat pump applications because they offer continuous control, low noise level, reduced vibration, low start current. The initial high-speed operation of the compressor can quickly control the temperature and obtain better performance coefficient (COP) than conventional on/off control [1]- [3]. To define the best control strategy and improve the efficiency of refrigeration systems, it is necessary to develop a simple and accurate model of the compressor, which plays an important role in the refrigerant system.
A large number of studies addressing compressor modeling approaches occurs in the current literature. Depending on the model purpose and available compressor information, three The associate editor coordinating the review of this manuscript and approving it for publication was Laurence T. Yang. categories can be distinguished: theoretical models, empirical models, and semiempirical models.
The theoretical model, also called the white-box model, is the most complex modeling approach. It is derived from the conservation of mass, energy and momentum considering the compressor geometrical dimensions and refrigerant properties [4], [5]. It is extremely difficult to develop a true white-box model of a compressor due to its inherently complicated structure and complex heat transfer and pressure variations. To date, no true white-box model is found in the open literature.
The empirical model, also called the black-box model, is the simplest, and easiest to implement, modeling approach. In ANSI/AHRI Standard 540 [6], third-order polynomial equations containing suction and discharge dew point temperature variables have been defined to express the power input, refrigerant mass flow rate and refrigerating capacity of a compressor operating at the rated frequency, VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ where the equation coefficients are commonly retrieved from manufacturer-provided catalog data. Based on the modeling method proposed in [6], Shao et al. [7] and Kim and Braun [8] presented similar second-order models with additional corrections for variable-speed compressors to predict the refrigerant mass flow rate and power input at any frequency. Other researchers applied the artificial intelligence method to build empirical compressor models. Yang et al. [9] proposed the loss-efficiency model, which includes the volumetric and isentropic efficiencies, to represent the compressor performance using neural networks. Ledesma et al. [10] independently developed a model of the refrigerant mass flow rate, power consumption and discharge temperature for a reciprocating compressor using an artificial neural network (ANN) to investigate the behavior of the above energy parameters without any parameter interactions. Tian et al. [11] applied an ANN model, partial least-squares (PLS) model and hybrid ANN-PLS model to predict the performance of scroll compressors and concluded that the ANN-PLS model performed better than did the others based on result comparison. However, empirical models are valid only under the conditions of the corresponding training data collection process, and their prediction performance decreases when the operating conditions exceed the training range. The semiempirical model, also called the gray-box model, is the most commonly adopted modeling approach. Winandy and Lebrun [12] developed semiempirical models that yielded a good estimate of the refrigerant mass flow rate, compressor electric power and refrigerant temperature at compressor discharge. Dardenne et al. [13] expanded their work to the variable-frequency domain and proposed a semiempirical model of a variable-speed scroll compressor. However, these models did not consider the influence of the heat transfer from the compressor to the environment. Fernando et al. [14] presented a semiempirical model considering the ideal evolution of the refrigerant throughout the compressor and the main loss sources in the compression process. This model contained ten empirical parameters, which could be acquired from experimental or catalog data. The model was validated against experimental data. Based on mechanical and data-driven analysis, Ma et al. [15] developed a hybrid model of the scroll compressor used in the microcompressed air energy storage system. In their paper, the operation process was analyzed, the parametric model variables were classified and extracted, and those variables suitable for measurement were adopted as the input variables. The model was validated against an actual microcompressed energy storage system. Semiempirical models are easy to implement in complex system models without more internal compressor characteristics as in the theoretical model. The semiempirical models built on the specific proprietary data from manufactures are more suitable in the development phase of the compressor. However, they cannot be used in the transient applications and cannot meet the control requirements of the system. To address this issue, this study proposes a semiempirical model built on the data in situ tests for transient applications. The contributions are as follows: (1) Based on the volumetric efficiency concept and the assumption of a polytropic compression process, a semiempirical model meeting the control requirements of the system is proposed; (2) A social learning particle swarm optimization (SLPSO) algorithm is developed to identify the unknown parameters in the system; (3) A test bench is constructed to validate the performance of the proposed model.
The remainder of the paper is organized as follows. In Section 2, theoretical models of the mass flow rate, discharge temperature of the refrigerant and the consumption of the compressor are presented. Section 3 discusses the method supported by the SLPSO algorithm. In Section 4, experimental tests are conducted to verify the performance of the proposed models. Finally, this paper is summarized in Section 5.

II. THEORETICAL MODEL AND DESCRIPTION
Owing to the complex structure of the compressor and refrigerant flow pathways, along which heat transfer and pressure change dramatically and rapidly, therefore the establishment of a detailed thermodynamic model of the compressor is extremely complex. To maintain a reasonable computational complexity level, a number of standard assumptions adopted in previous modeling efforts is adopted [16], [17], including the following: (1) All processes occur under steady-state conditions.
(2) The working fluid is an ideal gas.
(3) The compressor operates with adiabatic compression and expansion spaces.
(4) The instantaneous pressures in the compression and expansion spaces are uniform.
(5) The kinetic and potential energy levels of gas streams are negligible.
(6) The compression and expansion processes of the vapor in the cylinder are polytropic processes with the same polytropic exponent.
(7) The pressure drop across suction and discharge valves involves isenthalpic processes. (8) The oil in the compressor negligibly affects the working fluid.
(9) Leakage of gas to the outside environment of the compressor is assumed to be zero.
One compression cycle occurring within the cylinder of the reciprocating compressor includes four processes, namely, compression, discharge, expansion and suction, as shown in Figure 1.
Compression process (from state a to state b): In this process, the suction and discharge valves are all closed. If leakage past the piston rings and through the valve seals is neglected, the mass of the gas in the cylinder remains unchanged, but its volume is reduced from V a to V b . If the compression process is assumed to be a polytropic process, the following applies: where P is the pressure, V is the cylinder volume and n is a constant called the polytropic exponent. This process can be expressed as follows: Discharge process (from state b to state c): In this process, the discharge valve is opened while the suction valve remains closed. The gas in the cylinder flows into the discharge chamber though the discharge valve until the piston reaches the end of the stroke at position c. The volume remaining within the cylinder is the clearance volume, which is necessary to prevent any contact between the piston and head. Omitting the change in the specific volume in this process (v b = v c = v 2 ), the mass of the discharge gas is expressed as: Assuming the pressure remains unchanged (P d = P a = P 1 ), the work done in this process is expressed as follows: The compressor model also includes two features related to capacity control in real-time optimization applications. The first feature is related to the mass flow rate evaluation, and the second feature is related to the actual input power evaluation. In the following sections, we establish a compressor theoretical model based on the concept of volume efficiency and the assumption of polytropic compression process.

A. MASS FLOW RATE
Because of the clearance volume, the compressed refrigerant is not discharged completely, and therefore the state of the refrigerant at the beginning of the compression cycle differs from the state of the incoming refrigerant. Taking these factors into consideration, the volumetric efficiency η v , which is defined as the mass of the actual pumped steam divided by the mass of the ideal pumped steam when the compressor can handle the total piston displacement in the suction state, is expressed as follows: Based on the basic definition of volumetric efficiency, the following applies: where m cycle is the intake mass of the vapor per cycle and V disp is the compressor displacement. By combining Equations (5) and (6), the following is yielded: The mass flow rate pumped by the compressor is then given where ω k is the compressor rotary speed (rpm). Let a 1 = 60 and a 3 = 1 n , and by substituting v 1 = 1/ρ 1 , we obtain: where ρ 1 is the density of the intake working fluid. In Equation (9), the fluid property and compressor geometric factors are lumped into several constant parameters, namely a 1 − a 3 , which can be determined based on either manufacturer catalog data or real-time experimental data. Therefore, the mass flow rate is sufficiently described by the function containing three basic operating variables (i.e. P 1 , P 2 and ω k ) and the density ρ 1 . VOLUME 9, 2021

B. POLYTROPIC COMPRESSION POWER
The work required in one compression cycle of the compressor is written as: (10) Substituting Equations (2), (4), (5), and (7) into Equation (10) and after rearrangement, we obtain: Assuming the mass discharged in the discharge process m disc is equal to the mass pulled in the suction process m suct , which is reflected by the mass per compression cycle m cycle , namely, m disc = m suct = m cycle , we obtain the following: and Substituting Equations (12) and (13) into Equation (11) and after rearrangement, we obtain: Since Pv n = C = constant, the following applies: Substituting Equation (15) into Equation (14), we obtain: The polytropic compression power is expressed as: (17) Sinceṁ k = ω k 60 m cycle , Equation (17) can be written as follows:Ẇ Equation (8) is substituted into Equation (18), and v 1 is eliminated. After rearrangement, we obtain the following: and b 3 = n−1 n ; Equation (19) can be written as follows: The shaft power required by the compressor is calculated as: The electric power supplied to the motor driving the compressor is determined as:Ẇ

D. DISCHARGE TEMPERATURE OF THE WORKING FLUID
Regarding the polytropic compression process, the relationship between the exhaust and suction lines of the compressor is defined as: where ν is the specific volume of the refrigerant and subscripts ex and su denote the exhaust and suction points, respectively, of the compressor. Applying the ideal gas equation of state, PV = nRT , where n is the number of moles of a substance and R is the ideal gas constant, to Equation (23) and after rearrangement, the refrigerant exhaust temperature of the compressor is obtained as: Usually, the exhaust temperature T ex is higher than the discharge temperature T di because of the heat transfer from the discharge line of the compressor to the environment. According to the thermal resistance theory, the heat transfer from the refrigerant exiting the compressor chamber to the environment is expressed as follows: where Q ex , T ∞ and R ex are the heat transfer rate of the compressor exhaust line, the environment temperature and the total thermal resistance between the refrigerant in the compressor discharge line and the environment, respectively. Here, the thermal resistance includes three parts: where R ex,1 is the thermal resistance of the forced refrigerant convection, which can be expressed as a function of the refrigerant mass flow rate, as previously described in [18]: where b and e are coefficients, which are considered constants, R ex,2 is the thermal resistance of conduction through the compressor housing, which is considered a constant because the materials of the compressor housing are excellent heat conductors, and R ex,3 is the thermal resistance of natural air convection in the environment, which is also regarded as constant because it exhibits a low dependence on the 3158 VOLUME 9, 2021 compressor operating conditions. Therefore, the total thermal resistance R ex is ultimately expressed as: where c, which is a constant, is the sum of the two thermal resistances, i.e., R ex,2 and R ex, 3 . The heat transfer rate from the compressor exhaust line to the environment can also be expressed as the heat loss of the refrigerant in the compressor exhaust line: whereṁ r and c p are the mass flow rate and specific heat of the refrigerant, respectively. Combining Equations (25), (28), and (29) and after rearrangement, the refrigerant discharge temperature of the compressor can be written as follows: Substituting Equation (24) into Equation (30), the discharge temperature is defined as: where c 1 = bc p , c 2 = cc p , c 3 = n−1 n and c 4 = 1 − e are constants.

III. PARAMETER IDENTIFICATION
To identify the unknown model parameters, the sum of squares of the residuals between the evaluated and experimental data is adopted as the objective function. The optimization objective is to determine the minimum function value and the range of each parameter to be identified taken as a constraint. As such, the parameter identification problem is transformed into a constrained nonlinear optimization problem. Many optimization algorithms can resolve this problem. In this paper, the SLPSO algorithm [19] is adopted for its high search speed.

A. OBJECTIVE FUNCTION
To facilitate the identification of the unknown parameters, we define three constrained objective functions for three compressor models as follows:

B. OPTIMIZATION ALGORITHM AND DESCRIPTION
The selection of the constraint conditions affects the final result of the objective function optimization. If the range is very large, the calculation amount increases notably. Meanwhile, if the range is very small, it is difficult to determine the optimal value. Therefore, we need to choose a suitable range. According to the theory and simulation experiments, the following is finally determined: The mass flow rate model of the compressor is selected as an example to describe the optimization steps of the SLPSO algorithm. The optimization problem considered in this work is formulated as follows: where a = [a 1 , a 2 , a 3 ] T ∈ R D is the feasible solution set, D = 3 is the dimensionality of the search space, and f 1 (a) is the objective function as defined above. f 1 (a) is selected as the fitness function, and [X i,a1 (t) X i,a2 (t) X i,a3 (t)] T represents the state of the i-th particle at the t-th iteration, where X i,a1 (t), X i,a2 (t) and X i,a3 (t) are the values of VOLUME 9, 2021 a 1 , a 2 and a 3 , respectively. Regarding particles in different states, the smaller the calculated f 1 (a) value is, the closer the particle state is to the optimal solution. The specific optimization steps are as follows: Step 1: The population parameters are initialized, and 100 particles are randomly generated.
Step 2: The fitness value of each particle is calculated, and the minimum value is recorded.
Step 3: According to the calculation results in Step 2, the current optimal solutions of the population and particles are updated.
Step 4: The updated optimal solutions in Step 3 are adopted for behavior learning purposes. Before behavior learning, the calculated particle fitness values are arranged in descending order. According to the learning mechanism of the SLPSO algorithm, the particle status is updated based on Equation (36).
Each particle i defines a learning probability P L i , and p i (t) is the randomly generated learning probability. When the randomly generated learning probability is lower than the learning probability of the particle, the particle modifies its behavior; otherwise, it remains unchanged. The correction term X i,j (t + 1) is calculated according to Equation (37).
The correction term consists of three parts. The first part r 1 (t) · X i,j (t) involves the status update of the classical particle swarm optimization (PSO) algorithm. The second part r 2 (t)·I i,j (t) represents the result of particle i learning from any particle k better than itself. The third part r 3 (t) · ε · C i,j (t) includes integration at the whole-group level, i.e., learning from society. The main purpose of the addition of this item is to control the algorithm convergence and ensure the global search ability of the algorithm. The social learning coefficient ε is selected according to the group size and assumes a small positive number. r 1 (t), r 2 (t), and r 3 (t) are random numbers between 0 and 1.
Step5: Determination of whether the termination condition has been met after the status update is carried out. If it has been met, the optimal solution is output, which are the parameters to be identified. Conversely, the process continues with Steps 2, 3, and 4 until the optimal solution is attained.  With the use of the same method, the optimum parameters of the polytropic compression power and discharge temperature model are obtained.

IV. CASE STUDY A. EXPERIMENTAL EQUIPMENT DESCRIPTION
To verify the accuracy of the model, the compressed refrigeration system located in the Intelligent Building Laboratory of the Shandong Jianzhu University is employed to collect experimental data. The pilot plant consists of the four main components of a compressed refrigeration system, namely, a compressor, a condenser, an electronic expansion valve and an evaporator, as shown in Figure 2. The refrigerant used in this pilot plant is R134a.
A large number of sensors and instruments are installed in the system to record real-time system operation data, as shown in Figure 3. The operating range and accuracy of the sensors and instruments are listed in Table 1.

B. DATA PROCESSING
In practice, the refrigerant temperature at the compressor inlet and outlet, namely, T su and T di , respectively, and the suction and discharge pressures, namely, P 1 and P 2 , respectively, can be obtained by direct measurement with temperature and pressure sensors, respectively. The mass flow rateṁ k of the refrigerant through the compressor can be measured with a flowmeter. The electric power of the compressor can be measured with a power meter. The other variables that are difficult to directly measure may be determined via indirect methods.
The density ρ 1 of the working fluid in the compressor suction chamber is determined based on the thermodynamic properties of the working fluid using the measured suction pressure P 1 and inlet temperature T su , which are determined as follows: where the polynomial coefficients e ij can be calculated offline via curve fitting of data retrieved from a fluid property database.
The polytropic compression power can be determined by calculating the energy increase in the working fluid flowing through the compressor, which is expressed as follows: where h kri and h kro are the enthalpy levels of the working fluid pulled into and discharged out of the compressor, respectively, which can also be retrieved from a fluid property database using the measured temperature and pressure of the working fluid at the compressor inlet and outlet, respectively. and where the polynomial coefficients a ij and b ij can be calculated offline through curve fitting of data acquired from a fluid property database. A large amount of data is generated during compressor operation, and it is very important to extract valuable data for model parameter identification purposes. The data collected by sensors are often lost, repeated, disturbed, etc., so it is necessary to preprocess the data before parameter identification. A total of 4000 data sets were collected in the experiment, and the data were preprocessed according to the following strategies: (1) Unique data were deleted, which refers to those values that were accidentally recorded during the acquisition process.
(2) Missing data were computed, which originate from the data transmission error in the acquisition process. The average value of the same attribute data was selected for missing data completion.
Based on the preprocessed data, the data reflecting a variety of working conditions should be selected, and the data under specific working conditions should also be retained. The data value should be within a reasonable range so that the data fully reflects the working condition range of the compressor as much as possible. After processing 4000 data sets, 30 steady-state data sets were selected as the identification data of this experiment.

C. IDENTIFICATION RESULTS AND VERIFICATION
The average value of 10 operations is adopted as the optimization result, obtained using the SLPSO algorithm, and the parameter identification results are summarized in Table 2.
Twenty data sets were randomly selected from among the identified data to assess the modeling error. The results are shown in Figures 4, 5, and 6. As shown in these figures, the modeling errors are all within ± 5%.
To verify the prediction performance of the model in practical applications, 20 states were tested across the whole working scope. The mass flow rate, polytropic compression power and discharge temperature values predicted by the model were compared to the measured values, as shown in Figures 7, 8 and 9, respectively. The experimental results reveal that the prediction errors of the model are all within ± 8%.

D. COMPARISON TO THE LEAST-SQUARES METHOD
Based on the same identification data, the least-squares method was applied to determine the model parameters. The model determined by the SLPSO algorithm and that obtained VOLUME 9, 2021   by the least-squares method were employed for prediction, and the relative errors of the predicted and measured values are shown in Figures 10, 11 and 12. Table 3 summarizes the comparison in terms of the mean value of the relative error.   It can be indicated from Table 3 that the prediction performance of the model determined by the SLPSO algorithm is better than that of the model obtained by the least-squares method.

V. CONCLUSION
In this paper, three semiempirical models considering the mass flow rate, discharge temperature of the refrigerant and power consumption of the compressor were developed. These models were constructed on the basis of the volumetric efficiency concept and under the assumption of a polytropic compression process. The SLPSO algorithm was adopted to determine the unknown parameters of the above three models. An experimental apparatus of a refrigerant system consisting of a compressor, condenser, and electronic expansion valve was constructed to validate the proposed models.
Extensive tests were performed to validate the performance of these three models. The experimental results demonstrated that the prediction errors of the models were all within ±8%. Compared to the models obtained by the least-squares method, the proposed models determined by the SLPSO algorithm attained a higher prediction performance (the relative errors of the mass flow rate, compression power, and discharge temperature were 1.58%, 1.27%, and 2.1% lower, respectively).