Surrogate Models Applied to Optimized Organic Rankine Cycles

Global optimization of industrial plant configurations using organic Rankine cycles (ORC) to recover heat is becoming attractive nowadays. This kind of optimization requires structural and parametric decisions to be made; the number of variables is usually high, and some of them generate disruptive responses. Surrogate models can be developed to replace the main components of the complex models reducing the computational requirements. This paper aims to create, evaluate, and compare surrogates built to replace a complex thermodynamic-economic code used to indicate the specific cost (US$/kWe) and efficiency of optimized ORCs. The ORCs are optimized under different heat sources conditions in respect to their operational state, configuration, working fluid and thermal fluid, aiming at a minimal specific cost. The costs of 1449.05, 1045.24, and 638.80 US$/kWe and energy efficiencies of 11.1%, 10.9%, and 10.4% were found for 100, 1000, and 50,000 kWt of heat transfer rate at average temperature of 345 °C. The R-square varied from 0.96 to 0.99 while the number of results with error lower than 5% varied from 88% to 75% depending on the surrogate model (random forest or polynomial regression) and output (specific cost or efficiency). The computational time was reduced in more than 99.9% for all surrogates indicated.


Introduction
Energy, environmental, and economic issues have guided researchers into the optimization of available energy sources. The use of waste heat and low temperature renewable sources to generate electricity using organic Rankine cycles (ORCs) has gained attention in the last decade. However, the use of organic substances as working fluid in power cycles emerged in the mid-1820s when Thomas Howard replaced water with ether in a power machine [1]. Since then, several works have reported the use organic fluids in Rankine cycles and highlighted the contributions of Luigi d'Amelio, who developed an experimental turbine using ethyl chloride in 1954, and Harry Zvi Tabor and Lucien Bronicki, whom tested small solar ORC units (2 kWe and 10 kWe) with monochlorobenzene in 1961 [2][3][4].
Over the years ORC systems have demonstrated some important advantages when compared to conventional power generation technologies including: (1) lower operational pressure; (2) supercritical cycles at lower temperature and pressure; (3) the possibility of selecting positive condensing pressure; (4) the possibility of selecting a fluid appropriated to the thermal source available; (5) efficient systems at small sizes; and (6) simpler cycle configurations [5]. Due to the good features reported, the commercial use of ORCs is bustion engine. Kazemian and Gandjalikhan Nassab [41] used a second order auxiliary function as surrogate to determine operating and design parameters for a gas turbine optimized in terms of efficiency and power. This paper presents a comprehensive thermodynamic-economic optimization of structure, operating condition, working fluid and thermal oil for ORCs using heat sources from 100 kWt to 50 MWt at 70 • C to 350 • C. Two surrogate models are used to replace the thermodynamic-economic code in order to obtain quicker predictions for the optimized specific cost and efficiency. Thus, the novelty of this paper relies on:

•
Appling surrogate techniques to replace an entire optimization model instead of part of it as usually reported in the literature; • Evaluating the effect of different inputs used to represent heat source characteristics on the surrogates; • Making a comparison between stochastic and deterministic surrogates.

Methodology
The thermodynamic-economic model can choose between subcritical, Figure 1, and supercritical configuration, Figure 2, with or without recuperation. The working fluid is indicated in green, thermal fluid (i.e., heat source) in red, and cooling water is represented in blue. These four configurations were named: subcritical or basic ORC (BORC), supercritical ORC (SORC), basic recuperative ORC (BRORC) and supercritical recuperative ORC (SRORC).  Six working fluids are tested based on the commercial ORCs fluids available on market [6,42]. Their main environmental and safety indicators are summarized in Table 1. Syltherm 800 and Dowtherm A are selected as thermal fluids as they are widely used in solar thermal systems [43] and as ORC intermediary heat transfer fluid [44], both considered stable up to 400 • C and with melting point at −40 and 12 • C, respectively. As the heat exchanger used to heat the thermal fluid varies with the heat source characteristics, it was not considered in the thermodynamic-economic models.
The range of this application is defined by the inputs: (1) thermal fluid inlet temperature (T 8 ), (2) thermal fluid outlet temperature (T 11 ), and (3) heat transfer rate from the thermal fluid to working fluid ( . Q 8-11 ) as indicated in Table 2.

Thermodynamic Model
The ORCs are modeled in steady state condition, potential and kinetic energy variations as well as energy loss to the environment from pipes and heat exchangers are neglected. Heat exchanges pressure drop, pinch point temperature difference and the minimum vapor quality during expansion are calculated and imposed as optimization constraints. Table 3 indicates the main parameters used for modeling the ORCs. The isentropic efficiencies for the turbine (η T,ise ) and the pump (η P,ise ) are given in Equations (1) and (2), respectively, while energy balances for these components are given in Equations (3) and (4). . .
Minimum quality of working fluid (x T,min ) during expansion is verified dividing the turbine in ten small-stages and calculating the quality in each small-stage. The small-stages have constant polytropic efficiency (η T, poly ) and pressure ratio (pr T,ss ) as presented in Equation (5) [46]. Turbine reheat factor (RH T ) measures the inefficiency of the complete expansion [46] and it is calculated using Equation (6) in which ∆h ss,ise is the isentropic small-stage enthalpy difference.
The energy balance for all heat exchangers is calculated based on Equation (7), in which the subscribe c is related to heat exchanger cold side, h to hot side, in to heat exchanger inlet, and out to outlet.
Cooling tower energy balance, fan power consumption ( . W CT ) and pressure variation (∆P CT ) are calculated according to the Equations (8)-(10) [47][48][49], respectively. The enthalpy of saturated air leaving the cooling tower (h air,sat,out ) is calculated at average cooling tower water temperature (45 • C) according to equation presented in Cortinovis et al. [48], while enthalpy (h air,in ) and density (ρ air,in ) of humid air are calculated as proposed by Pontes, Yamauchi, and Silva [49]. Cooling tower fill height (Z) is given in Equation (11) in which . m c f is the cooling water mass flow rate and c p is the specific heat at the subscribed state. The integral at right-hand side of the Equation (11) is calculated based on Simpsons rule [47] and cooling tower mass transfer coefficient (Ka) is described in Cortinovis et al. [48]. . .
The rate in which heat is transferred from thermal fluid ( . Q 8−11 ), the net electrical power ( . W net ), and the cycle efficiency (η ORC,e ) are given in Equations (12)- (14). The subscribe c f is related to the cooling fluid. . .
Finally, the input parameters used to characterize the heat source, Table 2 can be represented by exergy transfer rate, Equation (15), or using the rate of heat transfer ( . Q 8−11 ) together with the average thermodynamic temperature (T ht f ,mean ), Equation (16), instead of T 8 and T 11 .

Plate Heat Exchangers Models
Plate heat exchangers (PHE) are commonly used in ORCs and were chosen due to their modular and compact format which usually provides high effectiveness [50,51] and low cost per area [52]. The rate in which heat is transferred from the thermal fluid to the working fluid, Equation (7), can also be written according to Equation (17).
The total heat exchanger area (A) is given in Equation (18) and the mean temperature difference (∆T mean ) is shown in Equation (19). In Equation (18) W is the plate width, L is the plate length and N pl is the number of plates.
The overall heat transfer coefficient (U) depends on the thermal resistances and can be calculated according to the Equation (20), in which t is the plate thickness, k pl is the plate conductivity, and hc is the convection coefficient at the subscribed side.
Characterization of the convection coefficient depends on the phase of the fluid at each heat exchanger side, Table 4 summarizes the equations used in each case.  [56] Plate heat exchanger pressure loss (∆p), Equation (21), is calculated as a sum of friction pressure loss (∆p f ric ), Equation (22), port pressure loss (∆p port ), Equation (23), elevation pressure loss (∆p ele ), Equation (24), and acceleration pressure loss (∆p ace ), Equation (25). The first three components are present in all heat exchangers while acceleration pressure loss is applicable only when there is a change in fluid quality.
∆p port = 1.4N pas G port 2 2ρ (24) The equations used to calculate friction coefficient were divided in three cases depending on phase of the fluid: no phase change and supercritical state, condensation, and evaporation. Table 5 shows the equations used in each case. Table 5. Friction coefficient equation for each phase of the working, thermal and cooling fluids.

Condition Equation Reference
No phase change/Supercritical state [57] Condensation f c = 94.75Re eq −0.0467 Re l −0.4 Bo 0.5 (p/p crit ) 0.8 [55] Thermodynamic, heat transfer, and pressure loss models were implemented using a Python code. The thermophysical properties are obtained using REFPROP v.10 [58] and CoolProp [59] with the exception for the transport properties of Solkatherm (SES36) for which extended corresponding states [59] using propane as reference fluid [60,61] are used.

Economic Model
The economic model for all components is given in Equation (26) according to Bejan et al. [62]. The reference cost (C re f ), reference capacity (X re f ) and the exponent α were obtained using Thermoflex ® [63]. In this equation, f p is a pressure factor, f m is the material factor, and X is the equipment capacity. The Chemical Engineering Plant Cost Index (CEPCI) used in the reference is the current value, and thus the ratio CEPCI re f /CEPCI is equal to 1.
Plant total cost is defined according to Equation (27) in which N equip is the number of ORC components.

Thermodynamic-Economic Optimization
The minimization of total cost per installed capacity (i.e., specific cost) was chosen as the objective function as indicated in Equation (28). The optimization constraints are presented in Table 6. The decision variables and their lower and upper bounds are shown in Table 7. Decision variables p 2 , p 1 , T 1 e T y were chosen since they represent operational aspects affecting the pumps, turbine and cooling tower power as well as the heat exchangers areas. On the other hand, the decision variables W evap , W cond , W rec , v evap , v cond , and v rec are project parameters related to the ORC heat exchangers area and pressure loss. Turbine inlet temperature Recuperator outlet temperature at cold side ORC optimization was carried out using a jMetalPy [64] genetic algorithm (GA) with a stopping criterion of 3000 generations. The four configurations (i.e., BORC, BRORC, SORC, and SRORC) using six working fluids and two thermal fluids were optimized separately for each combination of input parameters.

Surrogates for Optimized ORCs
The results obtained by the optimization together with the respective inputs are used to create surrogate models for quicker evaluation of optimized ORC specific cost (sc) and efficiency (η ORC ). The inputs and outputs used for training and validation of surrogate models are listed in Table 8. Random forest (RF) [65,66] and the polynomial regression (PR) [67] were selected as surrogate algorithms, which correspond to a non-parametric and a parametric method [68], respectively. Both are implemented in scikit-learn [69], a python module for predictive data analysis. In the case of PR surrogate, min-max-scaler [70] and power transformer [71] were required to normalize each input. The RF, on the other hand, did not require any transformation. Cross-validation [72] was applied with ten subsets of input/output for estimation of model performance. Figures 3 and 4 show the ORCs minimum specific costs as function of heat source average temperature for three cases of heat transfer rate (100, 1000, and 50,000 kWt). While Figure 3 indicates the ORCs configurations, Figure 4 indicates their working fluids.  It is possible to observe that the ORCs specific costs decrease with the increase in the heat transfer rate due to reduction in the specific costs of equipment. The ORCs specific costs also decrease with the increase in the average temperature in which the heat is transferred due to the increase in the cycle efficiency. The minimum specific costs found were 1449.05, 1045.24, and 638.80 US$/kWe with energy efficiency of 11.1%, 10.9%, and 10.4% at the maximum average temperature of 345 • C. For the minimum average temperature of 93 • C, the specific costs were 4238.45, 2857.46, and 1501.09 US$/kWe with energy efficiency of about 2.5% for all cases at heat transfer rates of 100, 1000 and 50,000 kWt, respectively.

Thermodynamic-Economic Optimization
As shown in Figure 3, SRORC (blue) provides the lowest costs across most temperatures at 50,000 kWt, while BRORC (green) achieves the lowest values mainly at 100 and 1000 kWt. BORC (orange), on the other hand, provides low costs for the lower temperatures since there is almost no room for superheated vapor at both turbine inlet and outlet at these temperatures.
From Figure 4, it is possible to note that the isentropic fluids, R1233zd (orange) and R245fa (red), dominate the applications at higher temperatures while wet fluids, R134a (blue) and ammonia (green), are the most reasonable fluids for the lower temperature region which agrees with their lower critical temperatures (Table 1). It is also important to stress that working fluid selection is more dependent on temperature than on heat transfer rate. Different fluid selection for different heat transfer rates at same temperature is possible, however. It may occur since the overall heat transfer coefficient may play a significant role as the heat exchangers specific cost (USD/m 2 ) changes with size.

Surrogates for Optimized ORCs
Surrogate and thermodynamic-economic models responses for the specific cost were assessed for three input groups representing the same thermodynamic condition: (1) heat input and output temperature (T 8 and T 11 ) and heat transfer rate (    It is clear from Figures 5-7 that some information is lost as the number of inputs decreases even though the heat source capacity to generate work can be represented by the three input groups. This lost information is related the sensibility of specific cost to temperatures and heat transfer rate in a magnitude different from that of exergy calculation. Table 9 shows that random forest surrogate performs slightly better than polynomial regression for all cases. This can be explained by the presence of many discontinuities during optimization (e.g., the presence or not of recuperator, working fluid type and ORC configuration). These discontinuities are better represented by heuristic models than by deterministic ones. Additionally, as the ORCs were optimized to provide the lowest specific cost, a weaker adherence is found for ORC efficiency. Nevertheless, the results indicate that surrogates can replace complex thermodynamic-economic models in broader optimization codes using deterministic or heuristic search methods. The errors that arise from these simplified representations must be properly analyzed. Although high R-squares are obtained (0.96-0.99), the number of cases with error lower than 5% can be as low as 75% depending on the surrogate, which may be prohibitive in some applications. Finally, the use of surrogates resulted in a significant reduction in processing time. While the thermodynamic-economic optimization requires around 723.2359 s to provide the efficiency and specific cost for a single application, RF and PR surrogates require only 0.0309 s and 0.0843 s, respectively, in a i5-10400F (4.3 GHz, 6 cores, 12 threads).

Conclusions
A detailed thermodynamic-economic model for optimization of ORCs was developed. Fluid selection and operational optimization were carried out to minimize specific cost for four ORC configurations subjected to a wide range of heat sources.
Optimizations revealed that R1233zd and R245fa were usually selected as the best working fluids for higher average temperatures while SRORC and BRORC were selected as best configurations in these conditions. For thermal sources with lower average temperatures, ammonia and R134a fluids and BORC configuration presented the lowest specific costs in most cases. The minimized specific costs ranged from 4238.45 to 638.80 US$/kWe while the energy efficiency varied from 2.5 to 11.1% as the heat source conditions varied from 100 kWt at 93 • C to 50,000 kWt at 345 • C, respectively.
Even though exergy transfer rate perfectly represents the capacity to generate work of a given heat source, there is loss of information when temperatures and heat transfer rate are grouped in a single input. This grouping of properties produces a negative impact on surrogates capacity to mimic the thermodynamic-economic model, especially when the objective function is an economic indicator.
The surrogates employing heat transfer rate and thermal fluid inlet and outlet temperatures provided R-square from 0.96 to 0.99. However, deeper evaluation of the error reveals that only 81% and 75% of the results were within a 5% of error range for RF and PR, respectively, what maybe be prohibitive in some applications. On the other hand, the processing time has been significantly reduced with the use of surrogate (99.996% and 99.988% for RF and PR models, respectively). This reduction allows the use of this optimization approach within broader and more complex optimization codes.