Copyright © the author(s). This work is licensed under a Creative Commons Attribution 4.0 International License. DOI: 10.14800/IOGR.1267 Received December 1, 2023; revised January 31, 2024; accepted February 21, 2024. *Corresponding author: ahmedelswisy22@gmail.com 1 Prediction of Brine Hydrate Formation Temperature Using ANN-Based Model Ahmed Elswisy*, Belayim Petroleum Company, Cairo, Egypt; Mohsen Elnoby, Future University in Egypt, New Cairo, Egypt; Adel Salem, Suez University, Suez, Egypt Abstract This study aims to leverage artificial neural networks (ANN) for predicting the hydrate formation temperature (HFT) of brines commonly employed in completion, workover, and well intervention operations. To achieve this goal, this study constructed a robust ANN model incorporating inputs such as the brine salts components' weight, gas specific gravity, pressure, and percentages of impurity gases (N2, H2S, CO2). To achieve highly accurate forecasts for hydrate formation temperatures in both monovalent and divalent brines, a comprehensive real dataset with a wide range of variations was utilized. Optimization processes were then conducted to identify the optimal configuration for the ANN structure. This included optimization of the training function and determining the appropriate number of hidden neurons, among other factors. The resulting ANN models proposed in this study provide a correlation that can be directly utilized to estimate the hydrate formation temperature. Introduction Completion Fluid. Completion fluid is pumped downhole to perform operations after the initial drilling of a well. Clear brine, as a completion fluid, is used to kill the well and remains in the wellbore until the new completion string is installed. It can also be used as a packer fluid, or as workover fluid for a remedial operation in the well. Using brine at HPLT (high pressure and low temperature) environment, which is available at deepwater environment, may arise troubles like hydrate formation (Figure 1)(Bellarby 2009). Figure 1—Gas hydrates plugs (Crumpton 2018). Hydrate. Gas hydrates are called clathrates which consist of two different molecules that are mechanically connected but not chemically bonded. Water, by hydrogen bonding, forms cage that is physically entraping gas molecules normally that is smaller than n-pentane. Methane, ethane, propane, butanes, CO2, N2, and H2S. They 2 are a solid structure of gas and water that closely resemble dirty ice or snow. It is discovered in 1810 by Sir Humphrey Davy (Sloan 2010). Gas hydrates have the potential to obstruct the tubing of the well, Christmas tree, and flowlines. It is crucial to exercise meticulous care to proactively prevent their formation by addressing potential causes and implementing remedial actions as needed (Zahedi et al. 2009). For deep and ultra-deep water wells, pressure could reach 10,000 psi and temperatures at seabed/mudline could be 35°F. These P-T conditions can activate the formation of the hydrates. Hydrates Formation. Formation of hydrates necessitates relatively low temperatures, high pressures, water and low-molecular weight gases, such as methane, ethane, propane, i-butane, n-butane, CO2, H2S, and nitrogen. When water mixed with low molecular weight gases with enough conditions of relatively low temperature and high pressure, hydrates is formed. The formed clatherates are a solid/rigid network of water molecules that cage in gas molecules of another substance (Figure 2). The most common gas could form hydrates is methane (CH4) (Bellarby 2009). Figure 2—Lattice crystal of hydrate (Bellarby 2009). As shown in Figure 3, it is a hydrates stability curve for a typical gas composition. It is inevitable that, with temperature reduction and pressure increase, the conditions are more suitable to form hydrates (Crumpton 2018). Figure 3—Example of hydrate stability curve. 3 Hydrates stability also depends on water salinity and the type of salt in the brine/electrolyte which forms the hydrates. The hydrate disassociation curves are shown in Figure 4 . One is for typical hydrocarbon gas mixed with pure water, and another is for formation water (50,000 ppm total solids) . Figure 4—Example of Hydrate Stability Curve (data source: Bellarby 2009). As shown in Figure 5, the hydrate stability curves for two monovalent brines are different from each other, due to different salt types. In Figure 6, for the same gas composition and salt types, the hydrate stability curve is different from each other due to different salt concentration. Figure 5—Hydrate stability curve for two monovalent brines (data source: Sloan 2006). Figure 6—Hydrate stability curve for three divalent brines (data source: Sloan 2006). 0 2 4 6 8 10 260 265 270 275 280 285 P re ss u re , M P a Temperature, K Hydrate Stability Curve 3% NaCl 15% NaCl, 8% KCl 0 50 100 150 200 280 285 290 295 300 305 310 315 P re ss u re , M p a Temperature, K Hydrate Stability Curve 5% CaCl2 4 Hydrate Formation Temperature Calculation. Experimental Measurements. Experimental measurements stand out as the most reliable and accurate method for determining hydrate formation temperature (HFT). Numerous scientists have conducted experiments encompassing various gas types and conditions to estimate HFT. Ng and Robinson (1985), for instance, delved into hydrate formation conditions for pure gases in the presence of solutions containing up to 20 wt% methanol. Bishnoi and Dholabhai (1993) reported data on hydrate formation conditions in electrolyte solutions, glycol, and methanol. Subsequently, Talaghat (2009) conducted laboratory studies to measure the rate of hydrate formation for pure gases in the presence of hydrate inhibitors. Ameripour (2009) made significant contributions by developing correlations to estimate hydrate formation pressure or temperature for different gas hydrates, both with and without inhibitors. This involved utilizing variables for regression and developing correlations, taking into account factors such as gas specific gravity, pseudo-reduced temperature and pressure, water vapor pressure, and liquid water viscosity. Visual Basic programming was employed to create these correlations. In a different study, Marinakis and Varotsis (2013) investigated the effects of aqueous phase salinity for two gas mixtures at varying salinity levels. K-Value Method. This method uses the vapour-solid equilibrium constants for predicting conditions of hydrate formation. ∑ 𝑦𝑖 𝑘𝑣𝑠,𝑖 = 1𝑁 𝑖=1 ......................................................................................................................................................(1) Gas Gravity Method. The gas gravity plot developed by Katz (1945) was a relation between the hydrate formation pressure and temperature with the specific gravity of natural gases. Empirical correlations to calculate hydrate formation conditions by gas gravity are Hammerschmidt (1936), Berge (1986), Kobayashi et al. (1987), Motiee (1991), and Ghiasi (2012) correlations. Hammerschmidt (1936) developed his hydrate temperature formation, where α and β are constant. 𝑇 = 𝛼𝑃𝛽.............................................................................................................................................................(2) Ghiasi (2012) proposed the following equation to 𝑇 = 𝐴0 + 𝐴1 × 𝑀 + 𝐴2 × 𝑀2 + 𝐴3 × 𝐿𝑛(𝑃) + 𝐴4 × (𝐿𝑛(𝑃)) 2 + 𝐴5 × 𝑀 × 𝐿𝑛(𝑃)....................................(3) Holder et al. (1988) proposed a simple relationship to calculate the hydrate formation pressure of pure gases, where gas is expressed in the relationship as coefficients (a and b). 𝑃 = exp (𝑎 + 𝑏 𝑇 ),...............................................................................................................................................(4) Thermodynamic Models. This method accounts for the interactions between water molecules which form the crystal lattice and gas molecules. Many models were proposed based on this method, such as Elgibaly and Elkamel’s model (1998) and Nasrifar et al’s model(1998). Javanmardi and Moshfeghian (1999) created a thermodynamic model for hydrate formation temperatures calculation of different hydrate in mixtures of common electrolytes (NaCl, KCl and CaCl2). Soft Computing Techniques. It is the method that does not involve the knowledge of the fundamental principles governing the process, such as artificial intelligence methods. They use the power of the big data for data analysis and interpretation, and models regressed by data training can be used to calculate and predict hydrate formation temperature. Heydari et al. (2006) used artificial neural network to predict hydrate formation temperature by using 167 of real data with the range of 32-74 °F for temperature, 50-4200 psia for pressure and 0.554-1 for gas specific gravity. Zahedi et al. (2009) used artificial neural networks to propose a model with gas specific gravity and pressure as inputs. Khajeh (2009) used adaptive neuro-fuzzy inference system (ANFIS) to obtain a new regression model. Fayazi (2014) used least square support vector machine (LSSVM) algorithm to construct the model to forecast hydrate formation temperature. Rashid et al. (2014) proposed an approach for methane hydrate formation temperature prediction accurately with the presence of salt, which is already dissolved in the water that will form the hydrate. They used 131 datasets to build a model that predict hydrate formation temperature using least square support vector machine (LSSVM) method. The input data for the model are gas specific gravity, hydrate formation pressure, and molality as an expression for salinity, and the output is hydrate formation temperature. The pitfalls of Rashid et al’s model was that the developed model was based on data of methane hydrate only and using salt molality without defining salt type. Olabisi et al. (2019) built an ANN model 5 which was trained using 459 hydrate formation experimental data points from Katz’s (1945) chart and Wilcox et al. (1941) chart. Specific gravity and pressure were chosen as the inputs in the 4-layer network, and hydrate formation temperature was the output. The data points were pressures were from 49 psia to 4000 psia, and gas specific gravity was 0.5539, 0.6, 0.7, 0.8, 0.9 and 1.0. El-hoshoudy et al. (2021) used Katz’s (1945) gravity chart to extract (1469) data points of gas hydrate formation pressure, temperature, and specific gravity. Also, Maekawa (2001) studied the different equilibrium conditions for gas hydrate of methane and ethane mixtures in pure water and 3.0 wt% NaCl solution. Nasrifir and Moshfeghian (2000) presented a model for pure CO2 and CO2-rich gas hydrate formation conditions prediction in aqueous solutions containing electrolytes and their mixtures. Methodology Data Pre-Processing and Acquisition. We started by data gathering, filtering, and cleaning. It was performed by removing the illogic and missing values, which is an important step in any ANN model to be accurate and successful. Data Description. In this study, about 200 datasets were collected form real data of monovalent brine and 300 datasets of divalent brine. Dataset consist of inputs, including weight percentages of the brine salts components for both monovalent brines (NaCl, KCl, NaBr) and divalent brines (CaCl2, CaBr2), gas specific gravity, pressure, and gas impurities percentages (N2, H2s, CO2), and the hydrate formation temperature as output. In the case of monovalent brines, a comprehensive statistical analysis was conducted for all data parameters, as outlined in Table 1. The data revealed a broad spectrum across these parameters. For example, NaCl weight percentage varied from 0% to 15%, KCl weight percentage ranged from 0% to 15%, NaBr weight percentage spanned from 0% to 30.6%, pressure fluctuated between 0.27 and 142 MPa, CO2 percentage ranged from 0% to 24.9%, H2S percentage exhibited a range from 0 to 17.6%, N2 percentage varied between 0% and 6.8%, and gas specific gravity ranged from 0.55 to 0.9. Moreover, the hydrate formation temperature showed a range between 264.4°F and 303.1°F. Table 1—Statistical analysis of monovalent brines. NaCl, % KCl, % NaBr, % P, Mpa CO2, % H2S, % N2, % Sp. Gr. T,K Mean 2.24 2.05 2.86 10.41 3.00 1.83 0.35 0.65 284.07 Standard Error 0.27 0.29 0.60 1.13 0.46 0.31 0.08 0.01 0.67 Median 0.00 0.00 0.00 5.19 0.00 0.00 0.00 0.65 284.20 Standard Deviation 3.64 3.95 8.22 15.52 6.25 4.13 1.11 0.09 9.19 Sample Variance 13.24 15.59 67.50 240.79 39.06 17.08 1.22 0.01 84.50 Kurtosis 2.23 2.68 5.40 33.60 2.96 6.03 29.02 0.02 -0.96 Skewness 1.69 1.96 2.65 4.95 2.01 2.53 5.37 0.88 -0.22 Range 15.00 15.00 30.60 142.15 24.90 17.60 6.80 0.34 38.70 Minimum 0.00 0.00 0.00 0.27 0.00 0.00 0.00 0.55 264.40 Maximum 15.00 15.00 30.60 142.42 24.90 17.60 6.80 0.90 303.10 Table 2 presents the results of statistical analysis for all parameters related to divalent brines. The data exhibited a considerable range across various factors. CaCl2 weight percentage varied from 0% to 33%, CaBr2 weight percentage ranged from 0% to 32%, pressure spanned from 0.27 to 204.58 MPa, CO2 percentage showed a range of 0% to 24.9%, H2S percentage had a range of 0% to 17.6%, N2 percentage ranged from 0% to 6.8%, and gas specific gravity varied between 0.55 and 0.9. Additionally, the hydrate formation temperature exhibited a range of 282.52°F to 309.75°F. 6 Table 2—Statistical analysis of divalent brines. CaCl2 CaBr2 P, MPa CO2 H2S N2 Gas sp. Gr. T,K Mean 16.61 10.17 41.51 1.73 0.99 0.15 0.77 282.52 Standard Error 0.71 0.71 2.80 0.26 0.17 0.05 0.01 0.82 Median 27.00 3.00 19.85 0.00 0.00 0.00 0.84 285.75 Standard Deviation 12.97 13.08 51.42 4.87 3.16 0.83 0.10 15.11 Sample Variance 168.24 171.11 2644.16 23.69 10.01 0.69 0.01 228.27 Kurtosis -1.75 -1.30 1.71 8.70 14.63 59.75 -0.80 -0.50 Skewness -0.43 0.80 1.61 3.04 3.75 7.73 -0.88 -0.55 Range 33.00 32.00 204.31 24.90 17.60 6.80 0.34 67.21 Minimum 0.00 0.00 0.27 0.00 0.00 0.00 0.55 242.54 Maximum 33.00 32.00 204.58 24.90 17.60 6.80 0.90 309.75 Correlation Coefficient. The correlation coefficient is employed to assess the connection between two parameters. It serves as a measure of the influence of each feature or input on the output. When numerous parameters impact the output, it can function as a screening or evaluation tool, helping identify the most impactful parameters and whether their effects are positive or negative. 𝐶𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝐶𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡(𝑥, 𝑦) = Σ(𝑥−𝑥𝑎𝑣𝑔)(𝑦−𝑦𝑎𝑣𝑔) √Σ(x−xavg)2Σ(𝑦−𝑦𝑎𝑣𝑔)2 ,.................................................................................(5) The correlation coefficient plots for different parameters in monovalent and divalent brines are depicted in Figures 7 and 8, respectively. Figure 7—Correlation coefficient of different parameters for monovalent brines. Figure 8—Correlation coefficient of different parameters for divalent brines. -0.6 -0.4 -0.2 0 0.2 0.4 0.6 NaCl KCl NaBr P CO2 H2S N2 Spec Grav. C o ef fi ci en t -0.6 -0.4 -0.2 0 0.2 0.4 0.6 CaCl2 CaBr2 P CO2 H2S N2 Spec Grav C o ef fi ci en t 7 Data Normalization. To prepare the data for constructing the ANN model, it is essential to perform data normalization. This step ensures that all variables are converted to a comparable scale, facilitating a more accurate and efficient learning process. To normalize the data within the range of -1 to 1, the following equation was applied. 𝑥𝑛𝑜𝑟 = 2 ∗ ( 𝑥−𝑥𝑚𝑖𝑛 𝑥𝑚𝑎𝑥−𝑥𝑚𝑖𝑛 ) − 1.............................................................................................................................(6) For monovalent brines: 𝑁𝑎𝐶𝑙 𝑤𝑡%𝑛𝑜𝑟 = 0.1333 ∗ 𝑁𝑎𝐶𝑙 𝑤𝑡% − 1,................................................................................................................(7) 𝐾𝐶𝑙 𝑤𝑡%𝑛𝑜𝑟 = 0.1333 ∗ 𝐾𝐶𝑙 𝑤𝑡% − 1,....................................................................................................................(8) 𝑁𝑎𝐵𝑟 𝑤𝑡%𝑛𝑜𝑟 = 0.0654 ∗ 𝑁𝑎𝐵𝑟 𝑤𝑡% − 1,...............................................................................................................(9) 𝑃𝑛𝑜𝑟 = 0.0141 ∗ 𝑃 − 1.0038,................................................................................................................................(10) 𝐶𝑂2 %𝑛𝑜𝑟 = 0.0803 ∗ 𝐶𝑂2% − 1,.........................................................................................................................(11) 𝐻2𝑆%𝑛𝑜𝑟 = 0.1136 ∗ 𝐻2𝑆% − 1,..........................................................................................................................(12) 𝑁2%𝑛𝑜𝑟 = 0.2941 ∗ 𝑁2% − 1,.............................................................................................................................(13) 𝛾𝑔 𝑛𝑜𝑟 = 5.8116 ∗ 𝛾𝑔 − 4.2064............................................................................................................................(14) When HFT is obtained, it will be normalized and to converted to original value by using the expression as follows, 𝐻𝐹𝑇 = 19.35 ∗ 𝐻𝐹𝑇𝑛𝑜𝑟 + 283.75................................................................................................................(15) For divalent brines, the equations used for data normalization are as follows. 𝐶𝑎𝐶𝑙2 𝑤𝑡%𝑛𝑜𝑟 = 0.0606 ∗ 𝐶𝑎𝐶𝑙2 𝑤𝑡% − 1 ,..............................................................................................(16) 𝐶𝑎𝐵𝑟2 𝑤𝑡%𝑛𝑜𝑟 = 0.0625 ∗ 𝐶𝑎𝐵𝑟2 𝑤𝑡% − 1,.............................................................................................(17) 𝑃𝑛𝑜𝑟 = 0.0098 ∗ 𝑃 − 1.0026,.......................................................................................................................(18) 𝐶𝑂2 %𝑛𝑜𝑟 = 0.0803 ∗ 𝐶𝑜2% − 1,................................................................................................................(19) 𝐻2𝑆%𝑛𝑜𝑟 = 0.1136 ∗ 𝐻2𝑠% − 1,.................................................................................................................(20) 𝑁2%𝑛𝑜𝑟 = 0.2941 ∗ 𝑁2% − 1,.....................................................................................................................(21) 𝛾𝑔 𝑛𝑜𝑟 = 5.8116 ∗ 𝛾𝑔 − 4.2064....................................................................................................................(22) When HFT is obtained from it will be normalized and to convert it to original value, use expression: 𝐻𝐹𝑇 = 33.606 ∗ 𝐻𝐹𝑇𝑛𝑜𝑟 + 276.14..............................................................................................................(23) Artificial Neural Networks (ANN). ANN is typically structured with three layers: input, hidden, and output layers. The methodology of ANN involves the utilization of weights and biases to establish connections between these layers, influencing the network's performance (Figure 9). The objective is to compare the target with the output value, measure the disparity between them, and then adjust weights based on this difference until it reaches an acceptable minimum value. The data undergoes various stages, including training, testing, and validation. In this study, the dataset was partitioned, allocating 70% for training and 30% for testing and validation purposes. 8 Figure 9—Flowchart of artificial neural network Network Optimization. The performance of the artificial neural network (ANN) of divalent and monovalent brines (Figures 10 and 11) will undergo optimization through the adjustment of two key factors: the training function and the number of neurons. Various training methods, including the Levenberg-Marquardt, Bayesian regularization, and scaled conjugate gradient methods, will be utilized for data training. The mean square error (MSE) will be computed, and the training method or number of neurons associated with the lowest error will be selected for optimal performance. 𝑀𝑆𝐸 = ∑ (𝑋𝑖𝑜−𝑋𝑖𝑝)2𝑛 𝑖=1 𝑛 ........................................................................................................................................(24) Figure 10—Network configuration for monovalent brines. The inputs for the hidden are calculated from the following expression, 𝑆𝑖, 𝑗 = ∑ (𝑤𝑖, 𝑗 ∗ 𝑥𝑗) + 𝑏𝑖𝑛 𝑖=1 ,..........................................................................................................................(25) where, i represents number of neurons, and j represents number of inputs, xj represents the inputs. The outputs from the hidden layer (according to Tan sigmoid activation function) are calculated using, 𝐻𝑖 = 2 1+exp (−2∗𝑆𝑖) − 1.............................................................................................................................(26) To get the final value of PCT, the function between output layer and hidden layer is linear and calculated by, 𝑁𝑒𝑡 = ∑ (𝑤2𝑖 ∗ 𝐻𝑖) + 𝑏2𝑛 𝑖=1 ,.........................................................................................................................(27) where w2i is the weight of neuron i at the hidden layer and output layer. 9 Figure 11—Network configuration for divalent brines. Results Analysis The correlation between the MSE and number of neurons for different training function were analyzed in this section for monovalent and divalent brines, respectively. Monovalent Brines. The configuration that yielded the smallest MSE was with 19 neurons in the hidden layer, using the Levenberg-Marquardt training function, resulting in an MSE of 0.315×10-2. With the Bayesian regularization training function, a setup featuring 14 neurons in the hidden layer achieved an MSE of 0.0693× 10-2. On the other hand, when using the scaled conjugate gradient training function, 19 neurons in the hidden layer produced an MSE of 3.15×10-2 (Figure 12). Table 3 summarized the weights and biases of the ANN model for monovalent brines with 14 neurons. Figure 12—MSE for various number of neuron by the different training functions for monovalent brines. 10 Table 3—Weights and biases of ANN model for monovalent brines. Neuron wi, 1 wi, 2 wi,3 wi,4 wi,5 wi,6 wi,7 wi,8 bi w2,i b2 1 0.442 0.265 -0.334 -0.235 0.243 0.149 -0.199 -0.593 -0.145 0.892 -0.41 2 1.226 1.383 -1.918 0.877 -0.213 -0.247 0.111 0.972 0.806 2.410 3 -0.061 -0.031 0.067 0.393 -1.051 -0.457 -0.064 -0.835 0.127 -1.521 4 -0.065 -0.262 -0.586 8.144 0.381 0.320 0.007 -0.925 8.334 7.163 5 0.330 0.847 0.360 -0.420 -1.079 -1.024 -0.575 4.795 -0.023 -2.392 6 -0.384 -0.094 -0.377 -0.107 0.183 0.154 0.050 -0.058 -0.141 0.672 7 0.086 0.052 -0.036 -0.458 0.984 0.666 0.082 0.868 -0.146 1.584 8 0.043 -1.221 0.529 -2.228 0.141 -0.592 1.381 -0.457 -1.553 2.252 9 0.051 0.259 0.845 0.601 -0.814 -0.508 0.120 3.773 -0.332 -1.926 10 -1.113 -1.037 -0.505 -1.639 0.730 0.469 0.550 -2.986 -0.585 -2.722 11 -0.109 -0.653 -0.753 5.698 1.090 0.745 -0.104 -2.697 5.299 -4.181 12 0.542 -1.335 -0.682 1.528 1.067 -0.885 0.430 -0.750 0.379 -1.698 13 -1.482 -1.001 -0.563 2.794 0.093 0.004 -0.460 -0.696 -0.263 2.280 14 -0.630 0.485 0.111 -2.987 0.463 0.548 0.290 -1.393 -1.651 -1.920 Divalent Brines. Under the Levenberg-Marquardt training function, employing 18 neurons in the hidden layer resulted in a MSE of 0.0237×10-2. Meanwhile, with the Bayesian regularization training function, utilizing 16 neurons in the hidden layer yielded an impressively low MSE of 0.0036×10-2. When employing the Scaled Conjugate Gradient training function, 15 neurons in the hidden layer led to an MSE of 1.88×10-2 (Figure 13). Table 4 summarized the weights and biases of the ANN model for divalent brines with 16 neurons. Figure 13—MSE for number of neuron by different training functions for divalent brines. 11 Table 4—Weights and biases of ANN model for divalent brines. Neuron wi,1 wi,2 wi,3 wi,4 wi,5 wi,6 wi,7 bi w2,i b2 1 -1.038 0.748 -1.604 -0.635 0.158 -0.597 2.590 -0.310 2.038 0.963 2 0.350 0.584 -15.123 -2.800 2.605 4.680 0.264 -10.534 -4.151 3 -0.634 -1.389 0.628 -0.118 1.668 -1.767 -4.848 -0.863 2.306 4 -0.834 -1.534 0.808 -1.292 0.552 0.235 -1.415 -0.410 -2.586 5 0.750 -0.045 -9.304 -0.963 2.174 6.270 0.426 -1.461 -6.474 6 -1.384 0.617 -1.516 -1.924 1.065 -0.002 2.083 -0.869 -2.303 7 1.339 -0.297 -9.484 -1.079 1.445 2.819 -0.220 -5.934 5.150 8 -1.591 0.068 6.329 -0.897 -0.513 -0.250 1.303 4.556 2.524 9 0.508 1.768 -3.732 -0.790 1.717 1.441 0.330 -1.284 3.178 10 1.142 -2.781 0.289 -0.554 0.169 0.136 -3.758 -1.801 2.431 11 -0.231 -0.405 8.515 0.402 -1.947 -6.867 -0.435 0.116 -6.637 12 -0.611 0.119 -0.554 -1.188 -1.505 1.447 -0.562 -0.724 3.457 13 -0.713 1.340 0.629 0.533 0.882 -0.148 0.609 0.241 2.448 14 -0.539 -0.282 -1.708 1.374 0.406 -0.684 5.769 -1.168 2.529 15 -0.617 -1.371 1.187 -0.314 1.335 0.086 2.503 -0.352 2.432 16 -0.674 -2.211 3.617 -1.207 -1.515 -1.332 -0.205 -0.044 3.486 Upon optimization, it appears that the Bayesian regularization training function exhibits the lowest error across both types of brines. Specifically, for monovalent brines, a 14-neuron network yields the most accurate match and the lowest MSE. In the case of divalent brines, a 16-neuron network demonstrates the best results with the lowest MSE. As shown in Figures 14 and 15, the predicted HFT by ANN model showed great agreement with actual HFT for both monovalent and divalent brines. Consequently, the weights and biases corresponding to these networks were chosen and employed for further investigation. Figure 14—Predicted HFT by ANN model vs. actual HFT for monovalent brines. 12 Figure 15—Predicted HFT by ANN model vs. actual HFT for divalent brine. Results Comparison. The ANN models were contrasted with the computed outcomes derived from Ameripour's (2009) correlation. The designated specific gas gravity was set at 0.645, and the NaBr brine concentration was 20% for monovalent brines. Figure 16—Hydrate pressure vs. temperature of the two models for monovalent brines. Table 5—Comparison of error% between the two models for monovalent brines. Pressure, MPA T, K T, K (Amereripour 2009) ER% T, K (ANN model) ER% 27.85 291.93 297.2729107 -1.830202692 291.6230148 0.105157 27.03 291.43 297.0856811 -1.940665368 291.4691147 -0.01342 21.65 290.98 295.6254951 -1.596499799 290.2123662 0.26381 20.51 290.71 295.2514293 -1.56218544 289.9994762 0.24441 13.65 288.43 292.2078762 -1.309806955 289.3868945 -0.33176 14.41 288.26 292.6366603 -1.518303018 289.5172242 -0.43614 0 5 10 15 20 25 30 286 288 290 292 294 296 298 P re ss u re , M p a Temperature, K Real Data Ameripour correlation ANN Model 13 In the case of divalent brines, the specific gas gravity was determined to be 0.572, with a CaCl2 brine concentration of 10%. Upon examining Figures 16 and 17, it becomes evident that the ANN model exhibits a closer alignment with actual data, showcasing a lower error rate (ER%). Tables 5 and 6 summarized and compared the error between two models for monovalent and divalent brines, respectively. Figure 17—Hydrate pressure vs. temperature of two models for divalent brines. Table 6—Comparison of error (%) between two models for divalent brines. P, MPa T, K T, K (Amereripour 2009) ER% T, K (ANN model) ER% 0.63 266.7 246.9805032 7.393887068 267.3144 -0.23036 0.88 269.2 256.6640622 4.656737649 269.1893 0.003977 1.14 271.1 263.1862017 2.919143606 270.9729 0.046876 1.44 273.5 268.420014 1.857398887 272.8247 0.246908 1.88 275.4 273.7304152 0.606239951 275.1539 0.089354 2.48 277.4 278.6079655 -0.435459812 277.6289 -0.08251 3.34 279.7 283.2550483 -1.271021911 279.8993 -0.07125 Conclusions This study introduces a novel method for predicting and estimating HFT values. The newly developed ANN HFT prediction model demonstrates its robustness when compared to other previously published HFT models. The methodology was applied to two distinct types of brines, monovalent and divalent, to enhance accuracy. The optimization strategies employed in each model proved successful in achieving high accuracy levels, with an R value of 0.95 for the monovalent brine model and 0.96 for the divalent brine model in the testing dataset. An additional noteworthy aspect of this study is its potential time-saving benefits in HFT estimation, making it particularly valuable for real completion operations, especially in high-pressure, low-temperature (HPLT) environments. Nomenclature 𝛾 = Gas specific gravity; Ki = Equilibrium constant for component i; Yi = Mole fraction of each component in the gas on a water free basis; M = Molecular weight; 0 1 2 3 4 245 250 255 260 265 270 275 280 285 290 P re ss u re , M P a Temperature, K Real Data Ameripour correlaton ANN Model 14 MSE = Mean square error. Acknowledgments I would like to express my sincere pray to my mentor Prof. Ahmed Gawish who has passed away. Conflicting Interests The author(s) declare that they have no conflicting interests. References Ameripour, S. 2006. Prediction of Gas-hydrate Formation Conditions in Production and Surface Facilities. MS thesis, Texas A & M University, College Station, Texas, USA. Bellarby, J. 2009. Well Completion Design. Berkeley, CA, USA: Elsevier. Berge, B. K. 1986. Hydrate Predictions on a Microcomputer. Paper presented at the Petroleum Industry Application of Microcomputers, Silvercreek, Colorado, 17-19 June. SPE-15306-MS. Bishnoi, P. R. and Dholabhai, P. D. 1993. Experimental Study on Propane Hydrate Equilibrium Conditions in Aqueous Electrolyte Solutions. Fluid Phase Equilibria 83: 455-462. Crumpton, H. 2018. Well Control for Completions and Interventions. Houston, Texas, USA: Gulf Professional Publishing. Elgibaly, A. A. and Elkamel, A. M. 1998. A New Correlation for Predicting Hydrate Formation Conditions for Various Gas Mixtures and Inhibitors. Fluid Phase Equilibria 152(1): 23-42. El-hoshoudy, A. N., Ahmed, A., Gomaa, S., et al. 2022. An Artificial Neural Network Model for Predicting The Hydrate Formation Temperature. Arabian Journal for Science and Engineering 22: 1-10. Fayazi, A., Arabloo, M., Shokrollahi, A., et al. 2014. State-of-the-Art Least Square Support Vector Machine Application for Accurate Determination of Natural Gas Viscosity. Ind. Eng. Chem. Res. 53(2): 945–958 Ghiasi, M. M. 2012. Initial Estimation of Hydrate Formation Temperature of Sweet Natural Gases Based on New Empirical Correlation. Journal of Natural Gas Chemistry 21(5): 508-512 Hammerschmidt, E. G. 1936. Gas Hydrates. Am. Gas Assoc. 7: 273-276. Heydari, A., Shayesteh, K., and Kamalzadeh, L. 2006. Prediction of Hydrate Formation Temperature for Natural Gas using Artificial Neural Network. Oil and Gas Business 2: 1-10. Holder, G. D., Zetts, S. P., Pradhan, N. 1988. Phase Behavior in Systems Containing Clathrate Hydrates: A Review. Reviews in Chemical Engineering 5(1): 1-70. Javanmardi, J. and Moshfeghian, M. 2000. A New Approach for Prediction of Gas Hydrate Formation Conditions in Aqueous Electrolyte Solutions. Fluid Phase Equilibria 168(2): 135-148. Katz, D. L. 1945. Prediction of Conditions for Hydrate Formation in Natural Gases. Transactions of the AIME, 160(1): 140- 149. Khajeh, A., Modarress, H., and Razaee, B. 2009. Application of Adaptive Neuro-Fuzzy Inference System for Solubility Prediction of Carbon Dioxide in Polymers. Expert Systems with Applications 36(3): 5728-5732 Kobayashi, R., Song, K.Y., and Sloan, E.D. 1987. Phase Behavior of Water/hydrocarbon Systems. Pet. Eng. Handb. 25:13- 16. Maekawa, T. 2001. Equilibrium Conditions for Gas Hydrates of Methane and Ethane Mixtures in Pure Water and Sodium Chloride Solution. Geochemical Journal 35(1): 59-66. Marinakis, D. and Varotsis, N. 2013. Solubility Measurements of (Methane+ Ethane+ Propane) Mixtures in the Aqueous Phase with Gas Hydrates Under Vapour Unsaturated Conditions. J. Chem. Thermodyn. 65:100–105. Motiee, M. 1991. Estimate Possibility of Hydrates. Hydrocarbon Processing 70:98-99. Nasrifar, K. and Moshfeghian, M. 2000. Computation of Equilibrium Hydrate Formation Temperature for CO2 and Hydrocarbon Gases Containing CO2 in The Presence of An Alcohol, Electrolytes and Their Mixtures. Journal of Petroleum Science and Engineering 26(4): 143-150. Nasrifar, K., Moshfeghian, M., and Maddox, R. N. 1998. Prediction of Equilibrium Conditions for Gas Hydrate Formation in The Mixtures of Both Electrolytes and Alcohol. Fluid Phase Equilibria 146(2): 1-13. Ng, H. J. and Robinson, D. B. 1985. Hydrate Formation in Systems Containing Methane, Ethane, Propane, Carbon Dioxide or Hydrogen Sulfide in The Presence of Methanol. Fluid Phase Equilibria 21(1-2): 145-155. 15 Olabisi, O. T., Atubokiki, A. J., and Babawale, O. 2019. Artificial Neural Network for Prediction of Hydrate Formation Temperature. Paper presented at the SPE Nigeria Annual International Conference and Exhibition, Lagos, Nigeria, 5-7 August. SPE-198811-MS. Rashid, S., Fayazi, A., Harimi, B., et al. 2014. Evolving a Robust Approach for Accurate Prediction of Methane Hydrate Formation Temperature in The Presence of Salt Inhibitor. Journal of Natural Gas Science and Engineering 18: 194-204. Sloan, E. D. 2010. Natural Gas Hydrates in Flow Assurance. Houston, Texas, USA: Gulf Professional Publishing. Talaghat M.R. 2009. Experimental and Theoretical Investigation of Simple Gas Hydrate Formation with or without Presence of Kinetic Inhibitors in a Flow Mini-Loop Apparatus. Fluid Phase Equilibria 279(1): 28-40. Wilcox, W. I., Carson, D.B, and Katz, D. L. 1941. Natural Gas Hydrate. Industrial and Engineering Chemistry 33: 662-669 Zahedi, G., Karami, Z., and Yaghoobi, H. 2009. Prediction of Hydrate Formation Temperature by Both Statistical Models and Artificial Neural Network Approaches. Energy Conversion and Management 50(8): 2052-2059. Ahmed Elswisy is a Petroleum Engineer at Belayim Petroleum Company which is a JV petroleum company in Egypt, where he has worked for the last 4 years. He also worked at scimitar petroleum company for 6 months and for FUE as teaching assistant for a year. His research interests are in drilling, completion and workover. He holds B.S. degree from Cairo University, and currently is a M.S. candidate in Petroleum Engineering of Suez University . Mohsen Elnoby is a professor in the department of petroleum engineering at FUE University. He was the Chairman of the board and MD of Petrodara petroleum company for 4 years, the Chairman of the board and MD of Qarun petroleum company for 2 years, the Chairman of the board and MD of General petroleum company– Egypt for 1 year. Since 2019, he has been working for FUE University as assoc. Prof. His research interests are in well completion, workover, and production engineering. He holds B.S. degree from Cairo University, and M.S. and Ph.D degree from Faculty of Engineering, Suez University, all in petroleum engineering. Adel Salem is the Head of petroleum engineering department at the Suez University. He worked as a field Petroleum Production Engineer at Qarun Petroleum Company Western Desert – Egypt for 1 year. Since 2008 he has been working for Suez University as assoc. Prof. and then as a Full Prof. His research interests are in Nanotechnology in EOR/IOR, drilling fluid, simulation of multiphase flow under steady and transient conditions. He holds B.S. and M.S. from Faculty of Engineering, Suez University, and Ph.D from Leoben University at Austria, all in petroleum engineering.