Energy conversion of heat from abandoned oil wells to mechanical refrigeration - Transient analysis and optimization

This study investigates the potential of using the geothermal energy from abandoned oils in a novel three-loop system; geothermal, power and cooling loops to produce cooling effect. The geothermal loop drives the power and cooling loops of a thermo-mechanical refrigeration (TMR) system consisting of expander-compressor units (ECUs). The system advantages lie in its simple, flexible, and low-cost design as well as in its ability to be driven by a low-temperature heat source (as low as 60 ◦ C). To evaluate the performance of the system, comprehensive models are developed including transient model for the abandoned oil well (geothermal loop) in spatial and time domains and thermodynamic and optimization models for the entire three-loop system. The effects of the temperature variation of the geofluid over operation time, the working fluids, the high pressure and the temperatures of the heat source and sink are investigated. Results show that at realistic and conservative conditions, the geofluid temperature considerably decreases for the first four months of operation (by an average of 30 ◦ C) and tends to be constant after half a year of operation. However, the geofluid temperature still high enough to drive the proposed geothermal TMR system over the full operation period. Among 43 investigated refrigerants, R1234ze(E) has higher efficiency, lower Pumping Work Ratio (PWR), and requires a smaller size of the heat exchangers. Using the genetic algorithm optimization method with R1234ze(E) as working fluid in both power and cooling loops, a maximum power loop efficiency of 6.3% and COP of 5.3 were obtained at a high pressure of 29 bar (in the power loop) with minimal expander diameter of 64, compressor diameter of 171 mm, and 18 expander-compressor units.


Introduction
The global energy demand is projected to increase by 30% by 2035 due to population rise and economic growth (Soltani et al., 2019).A significant portion of this global energy is consumed by HVAC systems for residential and commercial cooling applications (Laine et al., 2019) (Naimaster and Sleiti, 2013), especially in arid regions (Shublaq and Sleiti, 2020).This calls for more innovative and environment-friendly cooling technologies to address this ever-increasing cooling demand.Currently, there is a serious trend toward investment in renewable energy projects by governments and energy developers, however, renewable sources have several challenges that still need to be addressed.For instance, solar energy is not available at night and fluctuates through the day, months, and regions (Elbeh and Sleiti, 2021;Sleiti et al., 2020a) and hence, large solar power systems need complex and expensive storage systems.Similarly, wind energy changes throughout the year and ocean energy (Sleiti, 2017) is very limited to certain regions and needs high investment.Compared to other renewable resources, geothermal energy, however, is a stable resource and due to the temperature increase with depth below the earth's surface, geothermal energy is an available resource everywhere on the earth at depth of 3-10 km below the surface (Chiasson, 2016;Kharseh et al., 2015a).The technology is mature and contributes about 13.3 GW of all worldwide electricity (Lund and Toth, 2021;REN21, 2019), however this contribution is only 1.42% of all renewable electricity generation as the data compiled in Fig. 1 shows.
The growth of geothermal energy production is slow relative to other renewable resources owing to economic problems arising from the long project lead-times, resource-exploration risk, and high initial cost Abbreviations: DM, Direct method; ECU, Expander-compressor unit; GTMR, Geothermal thermo-mechanical refrigerator system; GM, Genetic method; TMR, Thermo-mechanical refrigerator system; GWP, Global warming potential; ODP, Ozone depletion potential; ORC, Organic Rankine cycle; VCC, Vapor-compression cycle; VMM, Variable metric method.(Cheng et al., 2013).The drilling cost, in particular, is accounting for about 50% of the overall project cost (Bu et al., 2012) and overcoming this cost would make the technology more attractive.Apart from the cost, geothermal energy has several advantages including consistency, vast amount of untapped potential, widespread availability (at depth), and wide range of possible applications, particularly wherever power and heat in some proportions are needed (Soltani et al., 2019).In terms of the technology that is currently being used, most geothermal plants around the world use flash-or dry steam technologies (Wang et al., 2016), which are suitable for high temperature resources.Recently, most geothermal plants under construction employ binary-cycle technology in which a geothermal fluid heats and vaporizes a separate working fluid.The binary cycle allows an effective and efficient extraction of heat for power generation from relatively low-temperature geothermal fluids (Kharseh et al., 2019).However, it is extremely important to predict the obtainable geofluid temperature (T gf ) within reasonable tolerance to make sure that it will not be decreased below the acceptable ranges for these technologies.Several studies in open literature have performed thermo-numerical estimations and highlighted the major factors that cause a sharp decrease of the T gf including the heat extraction rate and the thermal properties of the ground (Cheng et al., 2013;Huang et al., 2018;Mohamad Kharseh and Mohammed Al-Khawaja, 2015;D. Sui et al., 2019a).In general, the degradation of the geofluid temperature over the operation time (20-30 years) ranges from 5 • C to 20 • C from its initial value at an earlier time.
Abandoned oil wells (AOWs) can be utilized as a geothermal energy resource (D.Sui et al., 2019b) as these wells are already existing at deep depth (no drilling cost) and their available temperature is high enough (150 • C) that can be used in binary or dry cycle technologies.Several other studies in open literature proposed using geothermal energy extracted from abandoned oil wells for various applications including electricity generation (He et al., 2018;Noorollahi et al., 2015;Wang et al., 2020Wang et al., , 2018;;Zare and Rostamnejad Takleh, 2020), water desalination (Kiaghadi et al., 2017;Noorollahi et al., 2017b), heating (Li et al., 2019;Nian and Cheng, 2018a), and cooling (Kharseh et al., 2015b;Siddiqui et al., 2019;Yilmaz, 2017).In 2014, Cheng et al. (Cheng et al., 2014a) studied the power generation from AOWs using organic Rankin cycle (ORC) with a particular focus on the influences of the working fluids on the power generation efficiency.They concluded that using R134a and R245fa are more convenient than R600a, R600, propylene, R290, and R143a for the geothermal power generation using AOWs.Also, in 2014, Cheng et al. (Cheng et al., 2014b) analyzed the influences of the insulation on heat transfer from the production pipe to the injection pipe of the double-pipe AOW using R143a as a working fluid.They mentioned that with insulation of 0.03 m polystyrene, the fluid outlet temperature drops by 6 • C as compared to that of perfect insulation.In 2016, Cheng et al. proposed a novel method to enhance the power generation from the AOWs by developing thermal reservoirs at the bottom of the well.They reported that reservoirs improve the heat and electric output power of the well by about 4 times compared to the conventional well (without reservoirs).In 2018, Noorollahi et al. (Noorollahi et al., 2017a) proposed a solar-assisted geothermal power system from AOWs using a binary power plant.The AOW power system is integrated with photovoltaic (PV) and concentrated solar power systems using parabolic trough collectors.They stated that the integrated system increases the annual power by 23.5%.Furthermore, the energy of the AOW is proposed for the desalination process by Kiaghadi et al. (Kiaghadi et al., 2017).They found that an AOW with a depth of 4000 m and a geothermal gradient of 50 • C/km can produce 600,000 L of clean water per day.A new application for the AOW as underground thermal energy storage is proposed by Xie et al. (Xie et al., 2018).According to the analysis results, they found that there is an optimum well depth to get the maximum storage efficiency which strongly depends on the inlet temperature of the injected flow.For more details about the applications of the AOWs and their simulation method and economic considerations, these references could be cited (Kaplanog˘lu et al., 2020;Kurnia et al., 2021;Nian et al., 2019;Nian and Le, 2018a,b) .
Cooling demand, in particular, in the Gulf Cooperation Council (GCC) countries accounts for about 71% of the total consumed electricity (Refaat and Abu-Rub, 2015).These same countries have large number of unused abandoned wells that can be utilized as a thermal source for thermo-mechanical refrigeration (TMR) and cooling technologies for district cooling and other large-scale refrigeration applications.Besides its economic potential, this application also minimizes fossil fuel consumption as well as the energy losses associated with energy conversions (loss in generators and power transmission lines).In this context, Sleiti et al. (Ahmad K. Sleiti et al., 2020b) proposed using a novel thermo-mechanical expander-compressor unit (ECU) (developed by Encontech company (Glushenkov et al., 2018)) to drive a refrigeration system (TMR) without need for electric compressor.So in the present study, we propose to use this TMR system with heat input from the abandoned oil wells to produce refrigeration effect.This proposed system is referred to as geothermal thermo-mechanical refrigeration (GTMR) system.
Using the proposed GTMR system in hot and arid regions has many technical, environmental and economic advantages.The system can use an underground heat exchanger (UHEX) (Al-Nimr and Al-Ammari, 2019) for the condensation process as opposed to the air-cooled condensers and cooling tower condensers used by conventional systems.This UHEX consumes electricity only for a small circulating pump and the used working fluid (water) in the heat exchanger doesn't vaporize to the atmosphere.In comparison, the air-cooled condensers consume significant amount of electricity and the cooling tower condensers consume large amount of water, which is very limited in arid regions (Shublaq and Sleiti, 2020).Another advantage is that the cost of exploration is eliminated by using the already drilled wells, which accounts for about 50% of the overall project cost.The use of the GTMR system reduces the initial capital cost of the plant due to its simple design and low cost compared to conventional Vapor Compression Refrigeration Systems (VCRS) that use electric compressors, which consume tremendous amount of energy.Even when compared to other ECUs available in the market, the GTMR system has many advantages and less operational cost as detailed in (Elbeh and Sleiti, 2021), (Glushenkov et al., 2018).
The main contributions of the present study include: (i) proposing novel geothermal thermo-mechanical refrigeration (GTMR) system composed of an expander-compressor unit (ECU) and three integrated loops; the power loop, the cooling loop, and the geothermal loop; (ii) conducting transient analysis for the performance of the abandoned oil wells to predict the temperature-profile as a function of the well depth and operation time.(iii) investigating the most suitable working fluids for the TMR from 43 pre-selected refrigerants, and (iv) optimizing the performance of the GTMR system using genetic algorithm.
The rest of the manuscript is organized in four more sections.The components of the suggested system and its operation description are presented in Section 2. The thermodynamics modeling of the system is explained in Section 3. The performance of the system with various working fluids in addition to the effects of the major operating parameters are discussed in Section 4. Furthermore, in Section 4 results of the transient performance of the TMR system associated with the variation of the geofluid temperature over time are provided in addition to optimization results.Finally, Section 5 highlights the main findings and conclusions of this study.

GTMR system description
The proposed geothermal thermo-mechanical refrigeration system (GTMR) is shown in Fig. 2. The system consists of an expandercompressor unit (ECU) and three loops; the integrated power loop, the cooling loop, and the geothermal loop.The power loop has four main components including the working fluid heater, isobaric expander, condenser, and pump.The working fluid is pumped to the high pressure (process 1-2) then heated to a superheated state (2-3) by the heater of the power and geothermal loops, Fig. 1.In the geothermal loop (see Figs. 2 and 3), the heat supplied to the heater (point gf, in Fig. 2) is extracted from the abandoned oil well by circulating the geofluid (water) to the heater using a circulating pump.After exchanging the heat in the heater, the geofluid is circulated back to the well (point gf, out) in a closed-loop.The high-pressure working fluid (point 3) enters the expander via valve A (open) and expands in the expander pushing the expander piston to the left to compress the working fluid of the cooling loop.Some of the power produced by the expander is used to compress the fluid inside the hydraulic accumulator (HA) that is needed for the backstroke at the end of the isobaric expansion stroke in the expander.
The working fluid is then compressed in the compressor of the ECU, which causes the non-return valve B to open to pass the working fluid to the condensation process of the cooling loop.Since both the cooling and the power loops involve condensation processes, two condensers need to be used; one for each loop.However, we decide to use one common condenser for both loops to simplify the system, boost its performance, and reduce its cost as concluded by the authors of the present study in (A.K. Sleiti et al., 2020).Since the same working fluid is used in both power and cooling loops, the compressor fluid (point 6) and the expander fluid (point 4), which exits valve D (open) are mixed and directed to the common condenser (co, in).Part of the condensed fluid (co,out) is directed to the inlet of the power loop pump (state 1) to repeat the power cycle.The other part is directed to the expansion valve of the cooling loop (state 7).The cooling fluid is throttled (process 7-8) and evaporated by absorbing heat from a source such as a district cooling fluid (process 8-5) then directed again to the compressor via non-return valve C to repeat the cooling cycle.It worth mentioning that the produced cooling of the system can be delivered to a district cooling network as shown in Fig. 2 (w,out) or to other cooling load applications.
The TMR system in the present study has many advantages compared to the available in the market expander-compressor devices of the integrated organic Rankine cycle (ORC) with vapor-compression cycle (VCC) (A.K. Sleiti et al., 2020;Sleiti et al., 2020a).The proposed in the present study expander-compressor unit of the TMR system has simple, flexible, and low-cost design (Ahmad K. Sleiti et al., 2020b) (Sleiti et al., 2020b).Additionally, the TMR system can be driven by low-temperature sources (as low as 60 • C), (Ahmad K. Sleiti et al., 2020b;Sleiti, 2020).Another advantage is the availability of the abandoned oil wells at no drilling cost in Qatar and many other regions in the world that are not utilized.The TMR performance depends on the temperature of the geofluid (T gf,out ) which in turn depends on the available temperature of the abandoned wells.Given that the abandoned oil wells in Qatar have temperatures higher than 149 • C (Kharseh et al., 2019), this makes the TMR system even more attractive.Moreover, the proposed TMR can be applied for large cooling capacity systems by using multiple single ECUs connected in parallel.As mentioned before, the condensation process in the proposed system is performed by circulating water in an underground heat exchanger, which is another advantage of the proposed system as opposed to using conventional water-or air-cooled heat exchangers especially in arid regions, (Shublaq and Sleiti, 2020).

Energy models for the abandoned well, power, and cooling loops
To investigate the performance of the proposed system under transient conditions, first a comprehensive heat transfer model of a coaxial AOW was developed to model the abandoned well temperature variation along the well depth and over the operation time (Section 3.1).Then, the thermodynamic models for the power and cooling loops are  developed in Section 3.2 and sensitivity analysis is conducted for the entire system.

Transient model of the abandoned oil well
Fig. 3 shows a detailed schematic diagram of the geothermal loop components including the abandoned oil well which was refitted as injection pipe equipped with a coaxial exchanger (production pipe), circulation pump, and the heater of the power loop.The geofluid leaving the heater (point gf,out) is injected into the well to be heated by the surrounding formation.At the bottom hole, the heated geofluid (water) flows up reversely inside the insulated production pipe.Then, it is pumped by the circulation pump (point gf,in,cp) to the heater (point gf, in) to heat the working fluid of the power loop passing through the heater .It should be noted that the production pipe is insulated to minimize the heat transfer from the extracted fluid to the injected fluid.Furthermore, to achieve sufficient geofluid temperatures within the range between 70 • C to above 100 • C at moderate flow rates, the coaxial wellbore technology is used.
The transient model of the abandoned oil well is developed by applying the energy balance equation on the fluid passing through the production pipe and the injection pipe.As the temperature of the extracted fluid is higher than that of the injected fluid, a heat transfer occurs between the two fluids; so the energy equation in production pipe is expressed as follows (Nian and Le, 2018a): where T fp , v fp , ρ fp , and C p,fp are the temperature, velocity, density, and specific heat of the fluid in production pipe, respectively.T fi is the temperature of the fluid in the injection pipe.K represents the heat conductivity coefficient and given as (Bu et al., 2012): where r p,i and r p,o are the inner and outer radii of the production pipe including the insulation thickness, respectively.k il is the thermal conductivity of the insulation layer.h fp and h fi are the heat transfer coefficients of the fluid in the production and injection pipes, respectively, which are calculated from (Cengel and Ghajar, 2015): where n is 0.4 for the production side and 0.3 for the injection side.As the injected fluid is heated by both the surrounding formation and the extracted fluid, thus the energy equation of the injection well is given as (Nian and Le, 2018a): where r wb is the outer radius of the wellbore, h wb is the heat transfer coefficient between the injected fluid and the internal surface of the wellbore, and T wb is the temperature of the internal surface of the wellbore.For the numerical solution of Eqs. ( 1)-( 4), it is necessary to obtain the temperature of the wellbore which depends on conducted heat transfer between the wellbore and the surrounding formations.Thus, the transient heat conduction function presented by Ramey's definition is used as shown in Eqs. ( 5) and 6 to complete the transient model of the well as follows (Nian and Le, 2018a): where k sf , and T sf are the thermal conductivity, and the temperature of the formation, respectively.f(t) is the transient heat transfer conduction function which is given as: where ω represents the ratio of formation heat capacity and wellbore heat capacity, ω = (ρ sf Cp sf )/(ρ wb Cp wb ); τ D is dimensionless time, τ D = (α sf t)/(r 2 wb ); J 0 , and J 1 are the zero-order and first Bessel functions of the first kind, respectively.Y 0 and Y 1 are the zero-order and first Bessel functions of the second kind, respectively; u is the dummy variable.
As shown in Table 1, the geothermal gradient ΔT gg , as found in open literature, ranges from 25 • C/km to 45 • C/km (Caulk and Tomac, 2017;Chmielowska et al., 2020;Nian and Le, 2018b;D Sui et al., 2019;J D Templeton et al., 2014;Wight and Bennett, 2015).Consequently, an outlet geofluid temperature above 100 • C can be acquired for a well depth ≥ 4 km with a coaxial production pipe.For instance, many drilled oil wells in Qatar have a bottom well temperature higher than 149 • C (Adamson et al., 1998;Kharseh et al., 2015a).The main parameters of the abandoned well considered in this study are presented in Table 1.
To validate the model, the temperature profiles of the fluid in the injection and production pipes are compared with those presented by (Nian and Le, 2018a) as shown in Fig. 4. The comparison was performed at the first day of operation with geothermal gradient of 3.3 • C/km, flow rate of 20 m 3 /h, and well depth of 3000 m.The results show a good agreement with the reference profiles with a maximum error of 3.8% (relative to the reference data).

Thermodynamic models of the power and cooling loops
The T-s diagram of the proposed GTMR system is shown by Fig. 5 for the layout presented in Fig. 2. In developing the thermodynamic models of the system, the following assumptions were made: • The same working fluid is used in both the power and the cooling loops.
• The expansion process in the expander, see Fig. , is assumed to be isobaric.• The work required to charge the HA is assumed very small and therefore neglected.• The consumed power by the heat exchanger pumps is small and therefore negligible.• The power loop pump works isentropically.
• All heat exchangers are of a shell-and-tube type.
Starting with the power loop, Figs. 2 and 5, the consumed power by the power loop pump is given as (Cengel and Boles, 2015): where ṁpl,t is the total mass flow rate of the working fluid in the power loop, and η p is the isentropic efficiency of the power loop pump.The enthalpy at state 1 (h 1 ) is obtained from the quality x 1 = 0 and the condenser pressure, P 1 = P co,pl .The enthalpy at state 2 (h 2 ) is obtained from the pressure P 2 = P h and the entropy s 2 = s 1 = s(x 1 , P 1 ).
The working fluid is heated at constant pressure in the heater up to a superheated state (P 3 = P h , T 3 ).Both P h and T 3 are input parameters.The required heat rate through this process is: where the enthalpy h 3 is obtained from (P h , T 3 ).
In this study, a number of expander-compressor units (N ECU ), connected in parallel will be used to meet the total required refrigeration capacity of the system.The produced total power by all the expandercompressor units (ECUs) is (Ahmad K. Sleiti et al., 2020b): where N ECU is the number of the parallel ECUs, N is the stroke frequency of the ECUs in Hz or 1/s units, L is the length of the expander piston stroke, and A ex is the cross-sectional area of the expander piston.Through the backstroke of the expander piston, the working fluid is throttled to the condenser pressure (state 4), where h 4 = h 3 ′ .The enthalpy of the working fluid before throttling h 3 ′ is calculated from (Ahmad K. Sleiti et al., 2020b): During the power stroke of the expander, the cooling loop fluid is compressed from the evaporator pressure P e to the condenser pressure P co,cl .Then, the power fluid at state 4 and the cooling fluid at state 6 mix and enter the condenser at state (co, in).The enthalpy at this point h co,in is obtained from: where ṁcl,t is the total mass flow rate inside the cooling loop, h 6 is the enthalpy at the compressor outlet, and ṁco is the mass flow rate inside the condenser given as: The heat rejected by the condenser is given as (Ahmad K. Sleiti et al., 2020b): where h co,out is the enthalpy at the outlet of the condenser (same as state 1).For the cooling loop, the heat absorbed by the evaporator is given as: where the enthalpy at the inlet of the compressor h 5 is obtained from (P 5 = P e , x 5 = 1).The net power produced by the expander is equal to the power consumed by the compressor which are given as : (Elbeh and Sleiti, 2021; Ahmad K. Sleiti et al., 2020b): where ṁcl is the mass flow rate of the cooling loop fluid in each unit.It is obtained from: To determine the required expander and compressor diameters, the cooling loop is analyzed in terms of the chilled water: where ṁw is the mass flow rate of the water from the district cooling unit, T w,in is the inlet temperature of the water, and T w,out is its outlet temperature.
By specifying the inlet and outlet temperatures of the water and the required cooling load, the mass flow rate of the water, as well as the mass flow rate of the cooling loop fluid, can be calculated using Eqs.( 14) and ( 17).
Now, the mass flow rate of each compressor unit can be determined from the density ρ 5 , frequency N, length of stroke L, and the crosssectional area of the compressor cylinder A c as follows: From the definition of the cross-sectional areas of the expander and compressor Eqs. ( 20) and (( 21)), their diameters can be calculated: To determine the entire length of the evaporator tube, Eqs. ( 22)-( 24 A e = πD e L e (24) A similar approach is used to determine the lengths of the other heat exchangers (see the Appendix).Those other heat exchangers are the heater tube, the power and cooling loops condenser tube, the underground heat exchanger tube, Eqns.(A.9-A.12)and the geothermal heat exchanger tube.
It is important to compare the consumed power by the power loop pump to that produced by the expander.To do this, we define the pumping work ratio as (Sleiti et al., 2021a): The power loop efficiency is given as: where Ẇcp is the power consumed by the circulation pump of the geothermal loop, which is calculated by Eq. ( 27).
where ṁgf is the mass flow rate of the geofluid, ΔH is the hydraulic head losses due to friction in the geothermal loop pipe, and η cp is the isentropic efficiency of the circulation pump.ΔH is calculated using the Hazen-Williams equation, which is given as (Eck and Mevissen, 2015): where L is the length of the pipe, D is the inside diameter of the pipe, Vgf is the volume flow rate of the geofluid, and C is the Hazen-Williams coefficient (assumed 140 (Kharseh et al., 2019)).The coefficient of performance of the cooling loop is given as: The simulation process is performed using the Engineering Equation Solver (EES).Fig. 6 shows the flowchart of the calculation procedure and the parameters of the design point are given in Table 2.

Results and discussion
To evaluate the performance of the GTMR, the performance metrics (power loop efficiency and COP) were simulated under both steady and unsteady conditions.The transient results are discussed in Section 4.1.Then, sensitivity and optimization analyses for the power and cooling loops are performed and discussed in Sections 4.2 and 4.3, respectively.

Transient simulation results
The temperature-depth profile of the geofluid at different geothermal gradients is presented in Fig. 7.At a geothermal gradient of 34 • C/km, the geofluid enters the injection pipe at a temperature of 80 • C, which is higher than that of the formation which causes undesirable heat transfer to the formation.However, the injected fluid is also heated by the hot extracted fluid (even with insulation) along the production pipe.Therefore, the temperature of the injected fluid gradually increases and reaches its maximum at the well bottom (114.6 • C).Then, the fluid flows up in the production pipe and some of the heat is lost to the injected fluid which decreases its temperature to 104.9 • C at the top of the well (z = 0).At a higher geothermal gradient (45 • C/km), with a constant heating load of the heater and constant flow rate, the geofluid will be injected at a higher temperature (90 • C) and heated up to 139.4 • C at the well bottom which then decreases to 128.9 • C at the top of the production pipe.For efficient operation of the present GTMR system, the geofluid should be received at a temperature of 85 • C (at least).The minimum geothermal gradient that is able to provide this temperature with well depth of 4 km is 25 • C/km, see Fig. 7.
Fig. 8 shows the variation of the geofluid temperature at the bottom of the well with the operation time at different flow rates and geothermal gradient of 34 • C/km.The fluid temperature considerably drops (from an initial value of 152 • C) in the first four months of operations and tends to be constant after half a year of operation.At the design flow rate of the present system (32 m 3 /h), the bottomhole temperature stabilized at 117 • C which is sufficient enough to get the geofluid at a temperature higher than 100 • C at the inlet of the heater.
At a geothermal gradient of 34 • C and flow rate of 32 m 3 /h, the transient behavior of the power loop efficiency (η pl ) and the COP of the cooling loop were simulated with the operational time of the GMTR system at different high pressures in the power loop as shown in Fig. 9.
As expected, both of η pl and COP decrease over the operation time due to the degradation of the well temperature.Furthermore, it can be noticed that the η pl and COP at P high = 25 bar are larger than at P high = 15 bar or P high = 35 bar.Moreover, the gap between the 15 bar curves and 25 bar curves is larger than the gap between the 25 bar curves and 35 bar curves.This points out that there is an optimum high pressure at which the highest η pl and COP are achievable.So, the optimal design parameters for the proposed GTMR system are determined as discussed in the next section.

Effect of the working fluid and the operation parameters
The performance of the proposed GTMR system is affected by several factors and ambient parameters including the working fluid of the power and cooling loops, the pressure difference between the high and low pressure of each loop, and the temperatures of the heat source as well as of the heat sink of each loop.The effects of these parameters on the system performance are analyzed and discussed in the following sections.

Effect of the working fluid
The working fluid of the thermo-mechanical refrigeration system affects the size of the expander-compressor unit (ECU) since the size of this unit depends on the pressure difference of each loop, the frequency of the cycle, and the density of the working fluid.In the simulation, we defined the high pressure of the power loop while the low pressure

Table 2
Design point parameters of the GTMR system.  3 are those that meet the required range of operating parameters.Since each fluid has different saturation pressure at the pre-defined condensing temperature, the size of the expander diameter is affected accordingly as shown in Fig. 10(a).It should be noted that refrigerants R12 and R1234ze have the highest densities and, in general, the expander diameter is proportional to the inverse of the fluid density.However, the expander diameter of R1234ze is smaller than that for R12, although R1234ze has lower density than R12.This is due to that at 45 • C, the condensation pressure of R1234ze is lower than of R12, which reduces the required power to compress the fluid and so the size of the expander diameter.Also, the pressure at the exit of the evaporator affects the size of the expander; the higher the pressure at the exit of the evaporator the easier to compress the fluid to the condenser pressure.This explains the small diameter of R152a (for the lowest density fluid), which has the second lowest condensation pressure after R1243zf.The working fluid also affects the required power for the pumping process.The high pressure of the power loop greatly dominates the performance of the system.The expansion stroke and the capacity of the ECU are directly related to the higher pressure of the power loop (See Eq. ( 3)).So, the higher-pressure fluid requires smaller expander diameter as well as minimum heat to reach the superheated state, which in turn minimizes the size of the heat exchanger of the heater.Moreover, the higher-pressure fluid consumes more pumping power.
Thus, to compare the produced power by the expander to that consumed by the pump, the pumping work ratio (PWR) is calculated and shown in Fig. 10(b) for the selected fluids.The TMR system is considered a viable economic option as long as the PWR is lower than 25%.All fluids in Fig. 10(b) have acceptable PWR, however the final selection of the working fluid must be subjected to other factors such as the cost, the environmental effects, and the safety properties of the refrigerants.By investigating all these factors, Table 3, we can see that some refrigerants have good safety properties but negative environmental effects (high GWP) (such as R12, R500, R134a).Other refrigerants have low GWP, but their safety properties (toxicity and/or flammability) are not within the acceptable limit (such as R161, R290).Other fluids (R1234yf, R1234ze, R1243zf) have the lowest GWP with lower toxicity and lower flammability.As mentioned above, the final selection of the working fluids is a function of the cost and the overall performance of the system.As such, working fluid R1234ze(E) has a higher density, lower expander diameter, smaller PWR, and higher power loop efficiency than R1234yf and R1243zf.Also, R1234ze(E) is used as an alternative for R134a in medium temperature refrigeration and air conditioning systems including water chillers.Thus, R1234ze(E) is selected as the design working fluid in this work.
Finally, the working fluids also affects the size of the heat exchangers.Fluids with high heating/condensing loads need larger heat exchangers and provide lower power efficiency as evidenced by comparing Fig. 10(c) with Fig. 10(d).

High pressure effects
As mentioned before, fluid R1234ze(E) is selected as the working fluid in the present work and it will be investigated further with extended operating parameters.In this section, the effect of the higherpressure loop on the performance and size of the GTMR system is discussed.
Fig. 11(a) shows the variation of the power loop efficiency and the PWR with the operating pressure of the heater (P high ).On one hand, up to an optimum value of 24 bar, the higher pressure reduces the required heating load, which in turn increases the efficiency of the power loop.A: Lower toxicity, B: higher toxicity, 1: No flame propagation, 2: Lower flammability, 3: Higher flammability.
Any further increase in the high-pressure, results in increasing the required heating load and hence lowering the power loop efficiency.On the other hand, as the high-pressure increases the consumed pumping power increases as well.However, the slope of PWR line would be steeper beyond the optimum value of the high-pressure of the power loop.This is due to the additional increase of the required mass flow rate for higher heating load.Fig. 11(b) shows the effect of the high-pressure of the power loop on the entire length of the heat exchangers.As can be noted, the entire length of the heater is not affected by the variation of the pressure since we fixed the maximum temperature at 100 • C and the inlet temperature (at the exit of the pump) slightly increases with the pressure.The entire length of the system condenser (that rejects heat from the refrigerants to the water) and of the underground heat exchanger condenser (that rejects heat from the water to the soil) is proportional to the heating load of the heater; higher heating load yields higher condensing load too.

The effect of heat source and sink temperatures
The size of the heat exchangers depends mainly on their loads as well as on the design temperature differences at their inlets.As shown in Fig. 12(a), almost the entire length of the heat exchangers increases with the increase in the condensation temperature.This can be explained by that higher condensation temperature increases the required expander power, which also increases the heating load (by increasing the mass flow rate).It is also noted that the largest required length is for the underground heat exchanger.This is due to the low overall heat transfer coefficient between the cooling water and the soil.At the design cooling capacity of 100 kW, the largest length of the underground heat exchanger (at the design point conditions except that T co,pl = T co,cl = 55 • C) is 773.5 m, which is about 8 m long tube per 1 kW of cooling capacity.However, the heat exchanger can be made shorter and more compact if needed by using multi-pass exchanger and/or fins.
It should be noted that for locations with low soil temperature,  during summer season, the entire length of the underground heat exchanger decreases in non-linear behavior with the lower soil temperature.For instance, at the design point conditions with soil temperature of 30 • C, the size of the underground heat exchanger is 5 m/kW, while at soil temperature of 15 • C, the heat exchanger size reduces to 2 m/kW.So, the extraction of the geothermal heat from the abandoned oil wells should be performed using different types of heat exchangers (J.D. Templeton et al., 2014).In the present work, a coaxial heat exchanger is studied, which transfers the heat from the oil well to the geofluid.Fig. 12 (b) shows that the required useful length of the underground heat exchangers as a function of the soil temperature and the length of the heater as a function of the bottomhole temperature of the well.At the design point with T geo = 150 • C (available in the abandoned wells in Qatar), the suitable length is found to be 45 m.

Optimized performance of the GTMR system
To determine the optimal design parameters for the proposed GMRT system, the genetic logarithm (GA) is used.The GA method is selected because it is robust method and is not affected by the guess values like the other methods (Alharbi et al., 2020).Four decision variables significantly affect the performance, component sizes, and the capital & operational cost of the GMRT system.These variables are the temperature difference of the geofluid (ΔT gf = T gf ,in − T gf ,out ) through the coaxial well, the temperature difference between the geofluid and working fluid of the power loop at the hot end (ΔT h = T gf,in − T 3 ), the high pressure of the power loop P high , and the number of the ECUs (N ECU ) that are needed to provide the required cooling demand.The ΔT gf affects the flow rate of the geofluid and the power consumed by the circulation pump.ΔT h affects the design and size of the power loop heater as well as the common condenser.P high significantly affects the power loop efficiency and the COP of the cooling loop and N ECU affects the capital and the operational costs of the system.
As shown in Fig. 13, the optimization is performed with three objective functions; maximizing η pl , maximizing COP, and minimizing Ẇcp .The values of decision variables were optimized with the following ranges, Table 4 shows the optimization results where it can be noted that the values of the decision variables only differ in the N ECU .For instance, N ECU = 18 units when the objective function is minimizing Ẇcp , while N ECU = 12 when the objective function is maximizing η pl .At the first glance, it seems that the results of maximizing η pl are better than of minimizing Ẇcp .However, in the case of maximizing η pl , the required diameters for the expender and compressor pistons are larger than in minimizing Ẇcp (see Table 4).For fabrication purposes, the smaller piston diameters are more favorable than larger ones.So, the results of minimizing Ẇcp can be recommended for the optimal performance of the GTMR system with R1234ze(E) as the working fluid in both the power and cooling loops.

Conclusions
This study is one of the first that investigates the potential of using the geothermal energy from abandoned oils in a novel three-loop system (geothermal-power-cooling) to produce cooling effect.The geothermal loop drives the power and cooling loops of a novel thermo-mechanical refrigeration (TMR) system consisting of expander-compressor units (ECUs).The attractiveness of the TMR system lies in its simple, flexible, and low-cost design as well as in the ability of the system to be driven by low-temperature sources (as low as 60 • C).Comprehensive thermodynamics models of the system are developed and the major performance parameters are analyzed and discussed.The transient performance of the proposed system with the variation of the mean geofluid temperature in spatial and time domains is investigated.Parametric studies are performed for the effect of the working fluids and the major parameters and the system is optimized using genetic algorithm.The main conclusions are summarized as follows: • At realistic and conservative conditions, the geofluid temperature considerably decreases for the first four months of operation (by an average of 30 • C) and tends to be constant after half a year of operation.However, the geofluid temperature still high enough to drive the proposed geothermal TMR system over the full operation period.
• The working fluid of the power and cooling loops plays the most important role in the performance of the system.Fluids with low pressure at the condensing temperature and high pressure at the evaporating temperature show superior performance.• The high pressure of the power loop influences the design of the TMR unit.For compact and viable design, the working fluid should have high pressure at low temperatures and the PWR should not exceed 25%.• Among the 43 investigated refrigerants, R1234ze(E) showed higher efficiency, lower PWR, which resulted in a smaller size of heat exchangers in addition to its very low GWP and zero ODP with a safety class of A2. • As an alternative to air-and water-cooled heat exchangers, the underground heat exchanger is recommended.Results showed that at a soil temperature of 30 • C, the required length of the underground heat exchanger is about 5 m/kW of cooling capacity.
• At a geothermal temperature of 150 • C, soil temperature of 29 • C, and with R1234ze(E) as the working fluid, a cooling load of 100 kW could be generated using 20 units of ECUs.Each unit has an expander diameter of 91 mm, compressor diameter of 166 mm, and a stroke length of 160 mm.• Using the genetic algorithm optimization method with R1234ze(E) as working fluid for both power and cooling loops, maximum power efficiency of 6.3%, and COP of 5.3 were obtained at P high = 29 bar, ΔT gf = 40 ∘ C, ΔT h = 5 ∘ C, and N ECU = 18 for the minimal expander and compressor diameters of 64 mm and 171 mm, respectively.

Fig. 4 .
Fig. 4. Validation results of the present study (solid lines) compared to those reported by (dashed line) (Nian and Le, 2018a).

Fig. 7 .
Fig. 7.The variation of the geofluid temperature with the well depth in the injection pipe (T fi , solid lines) and production pipe (T fp , dashed lines) at different geothermal gradients and flow rate of 32 m 3 /h.

Fig. 8 .
Fig. 8. Change of the fluid temperature at the bottomhole of the well with time at different flow rates.

Fig. 9 .
Fig. 9. Change of power loop efficiency and COP with operation time.

Fig. 10 .
Fig. 10.Effects of the working fluid on the performance of the GTMR system.(a) densities and expander diameter, (b) PWR, (c) power loop efficiency, and (d) heater load of the selected fluids at design point.

Fig. 11 .
Fig. 11.Effects of the high-pressure of the power loop on (a) the performance and (b) size of the GTMR system.

Fig. 12 .
Fig. 12. Effects of (a) condensing temperature of power and cooling loops, (b) geothermal-source and soil temperatures on the size of the heat exchangers.

Table 1
Basic parameters of the abandoned oil well.

Table 3
Thermodynamics and environmental properties of the selected working fluids.