Bhajan Lal Cornelius Borecho Bavoh Jai Krishna Sahith Sayani Editors Machine Learning and Flow Assurance in Oil and Gas Production Machine Learning and Flow Assurance in Oil and Gas Production Bhajan Lal · Cornelius Borecho Bavoh · Jai Krishna Sahith Sayani Editors Machine Learning and Flow Assurance in Oil and Gas Production Editors Bhajan Lal Chemical Engineering Department Universiti Teknologi Petronas Seri Iskandar, Perak, Malaysia Cornelius Borecho Bavoh Chemical Engineering Department Universiti Teknologi PETRONAS Bandar Seri Iskandar, Malaysia Jai Krishna Sahith Sayani Department of Chemical and Bioprocess Engineering University College Dublin Belfield, Ireland ISBN 978-3-031-24230-4 ISBN 978-3-031-24231-1 (eBook) https://doi.org/10.1007/978-3-031-24231-1 © The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland Preface The use of digital or artificial intelligence methods in flow assurance has increased recently to effectively achieve fast results without any thorough training. Generally, flow assurance covers all risks associated with maintaining the flow of oil and gas during any stage in the petroleum industry. Flow assurance in the oil and gas industry covers the anticipation, limitation, and/or prevention of hydrates, wax, asphaltenes, scale, and corrosion during operation. The occurrence of flow assurance challenges mostly leads to stoppage of production or plugs, damage of pipelines or production facilities, economic losses, and in severe cases blowouts and loss of human lives. A combination of several chemical and non-chemical techniques is mostly used to prevent flow assurance issues in the industry. However, the use of models to anticipate, limit, and/or prevent flow assurance problems is recommended as the best and suitable practice. The existing proposed flow assurance models on hydrates, wax, asphaltenes, scale, and corrosion management are challenged with accuracy and precision. They are not also limited by several parametric assumptions. Recently, machine learning methods have gained much attention as the best practice for predicting flow assurance issues. Examples of these machine learning models include conventional approaches such as Artificial Neural Network, Support Vector Machine (SVM), Least Squares Support Vector Machine (LSSVM), Random Forest (RF), and hybrid models. The use of machine learning in flow assurance is growing, and thus relevant knowledge and guidelines on their application methods and effectiveness are needed for academic, industrial, and research purposes. In this book, we focused on the use and abilities of various machine learning methods in flow assurance. Initially, basic definitions and use of machine learning in flow assurance are discussed in a broader scope within the oil and gas industry. The rest of the chapters discuss the use of machine learning in various flow assurance areas such as hydrates, wax, asphaltenes, scale, and corrosion. Also, the use of machine learning in practical field applications is discussed to understand the practical use of v vi Preface machine learning in flow assurance. This book is useful to flow assurance engineers, students, and industries who wish to be flow assurance authorities in the twenty-firstcentury smart oil and gas industry. Seri Iskandar, Malaysia Bandar Seri Iskandar, Malaysia Belfield, Ireland Bhajan Lal Cornelius Borecho Bavoh Jai Krishna Sahith Sayani Contents 1 Machine Learning and Flow Assurance Issues . . . . . . . . . . . . . . . . . . . Cornelius Borecho Bavoh and Bhajan Lal 1 2 Machine Learning in Oil and Gas Industry . . . . . . . . . . . . . . . . . . . . . . Jai Krishna Sahith Sayani and Bhajan Lal 7 3 Multiphase Flow Systems and Potential of Machine Learning Approaches in Cutting Transport and Liquid Loading Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Muhammad Saad Khan, Abinash Barooah, Bhajan Lal, and Mohammad Azizur Rahman 27 4 Machine Learning in Corrosion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jai Krishna Sahith Sayani and Bhajan Lal 59 5 Machine Learning in Asphaltenes Mitigation . . . . . . . . . . . . . . . . . . . . Ali Qasim and Bhajan Lal 81 6 Machine Learning for Scale Deposition in Oil and Gas Industry . . . 105 Sirisha Nallakukkala and Bhajan Lal 7 Machine Learning in CO2 Sequestration . . . . . . . . . . . . . . . . . . . . . . . . 119 Amirun Nissa Rehman and Bhajan Lal 8 Machine Learning in Wax Deposition . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Ihtisham Ul Haq and Bhajan Lal 9 Machine Learning Application in Gas Hydrates . . . . . . . . . . . . . . . . . . 155 Ali Qasim and Bhajan Lal 10 Machine Learning Application Guidelines in Flow Assurance . . . . . 175 Cornelius Borecho Bavoh and Bhajan Lal vii Chapter 1 Machine Learning and Flow Assurance Issues Cornelius Borecho Bavoh and Bhajan Lal Abstract This chapter briefly discusses the main challenges facing the flow assurance related areas in the oil and gas industry. It also provide simple fundamental definitions to machine learning vocabulary to introduce to machine learning terms. Keywords Machine learning vocabularies · Flow assurance · Hydrates · Scales · Corrosion 1.1 Introduction Flow assurance issues has increased recently owing to the recent increase in the production of oil and gas in harsh environments [1]. Most of such issue arise from the production and transportation pipelines in the oil and gas industry. The term flow assurance is the process of successfully ensuring the economic flow of hydrocarbon stream from the reservoir to the point of sale. The major oil and gas flow assurance issues include wax, hydrates, asphaltenes, scales, and corrosion, etc. [2]. The knowledge of multiple discipline studies with a combination of chemistry, multiphase hydrodynamics, thermodynamics, kinetics, and materials science. The main flow assurance issues are briefly discussed in this section for the better understanding of the entire book [2, 3]. C. B. Bavoh Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia B. Lal (B) Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar Perak, Malaysia e-mail: bhajan.lal@utp.edu.my © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_1 1 2 C. B. Bavoh and B. Lal 1.2 Flow Assurances Challenges 1.2.1 Wax Deposition The deposition of wax is a very common flow assurance issue in the petroleum industry. The deposition of wax occurs because of the precipitation of paraffin constituents in crude oil. The paraffins are mostly alkanes with carbon numbers greater than 20 [4, 5]. The precipitation of wax in crude oil flow is controlled by the operating pressure and temperature, the crude oil compositions, the flow rate, shear stress, and the crude viscosity. Wax precipitation occurance in pipelines can lead to stoppage in crude flow, leading to pipeline blockage and stoppage in production. Usually, the use of pigging, and chemical additives is preferable for wax precipitation prevention and/or removal [5]. 1.2.2 Corrosion The deteriorating of metals due to chemical reactions between the metal and its surrounding is known as corrosion. The rate and form of corrosion is controlled by the type of environment (especially the presence of gaseous systems) and metals under consideration. Pipeline corrosion is one of the main causes of subsea pipeline failure. Therefore, it is very necessary to regulate and control pipeline condition to effectively predict likely failures during operations [6]. 1.2.3 Asphaltene Asphaltenes are basically compounds that are polar and soluble in nature and are present in heavy crude oil fractions. Just like hydrates, asphaltene has the tendency of plugging pipelines and reservoir pores. Mostly asphaltene precipitation occurs as a result of thermodynamic conditions variations, crude viscosity, and the constituent of the crude oil. Asphaltene that contains chemical components such as carbon, hydrogen, nitrogen, oxygen and sulfide, and has aromatic cyclic structures are chemical asphaltene. Similar to hydrates, asphaltene precipitation is more likely to occur in an undersaturated, light reservoir fluid than a heavy hydrocarbon system. When asphaltenes form in pipelines and reservoirs, they mostly lead to oil production declines, higher viscosity and water–oil emulsion [7]. 1 Machine Learning and Flow Assurance Issues 3 1.2.4 Scales Scales are water forming deposits formed during oil and gas transportation. This water forming deposits are formed as crystals from insoluble salt or oxides trapped in the water molecules. The precipitation of scales is a result of the incompatibility of salts molecules in owing to water their individual solubility in exceeded in water [8, 9]. These molecules become difficult to travel out, hence they precipitate and in severe cases lead to plugging. Similar to other flow assurance issues, scales formation is thermodynamically driven. Other factors such as scales forming species concentration, water quality, hydrodynamic conditions, and pH also influence scale formation. There are several existing techniques used to reduce scale formation. These are mechanical means, chemical dissolution and the use of scale inhibitors. The formation and deposition of scales can lead to formation damage and production equipment failure during the development of a reservoir. In case of waterflooding, complex geochemical processes between the injection water, formation water, formation rock, and the concentration of ions can cause operational challenges. Major contribution of scale control concentrates on understanding the conditions for scale formation and its inhibition [8, 9]. 1.2.5 Hydrates Hydrates are solid inclusion crystalline substance that are icelike in nature and are formed at high pressure and low temperature conditions. Hydrate is formed in the presences of high pressure, low temperature, the presence of water, and the presence of hydrate forming molecules (gas or liquid, but most hydrate formers are gaseous) [10–12]. Common gas hydrate formers are light hydrocarbons (e.g. methane, ethane, propane, isobutane) and inorganic molecules such as CO2 and H2 S. Despite some interesting potential of gas hydrates in sea water desalination, carbon capture and storage, gas transformation and future energy source, their formation in flow assurance systems or operations are strictly prohibited and unwanted. Aside gas dominated systems, Oil dominated flowlines are proven to be prone to hydrate formation at subsea low temperatures and high-pressure conditions, thereby leading to hydraterelated flow assurance issues. The formation of hydrates in pipelines leads to production stoppage, pipeline blockage, and in very serious scenarios lead to loss of lives [13]. Therefore, for a smother flow assurance process, all these floe assurance related issues need to be avoided. 4 C. B. Bavoh and B. Lal 1.3 Machine Learning Vocabulary Since this book focuses of the use of machines learning algorithms in flow assurance, it is proper to first understand some few machine learning vocabularies. This will set a bases for readers to effectively follow the discussed in the rest of the book [14]. Some important machine learning vocabularies used in this book are explained as follows. • Algorithm: an algorithm consists of a set of commands issued to an AI, neural network to conduct a task specific job. The part of a system or neural network that engage in problem solving is the algorithm. • Artificial Intelligence: It is the capability of a system to imitate human behavior. • Artificial Neural Network: This consist of several models that learn like the human brain in systems for solving complex problems. • Big Data: Extremely large data sets that are analyzed to reveal patterns, trends, and associations related to human interaction. • Classification: This is basically algorithms used to assign categorical data set in a software. • Deep Learning: A subset of machine learning that uses specialized algorithms to model, understand and mimic complex behavior structures and relationships in data. • Genetic algorithm: An algorithm based on principles of genetics used to efficiently and quickly find solutions. • Machine Intelligence: The overall concept of machine learning, deep learning, and classical learning algorithms. • Machine Learning: An application of AI that provides systems the ability to learn and improve from experience without any specific instructions being programmed into it. • Machine Translation: Applying NLP to translate language whether via text or voice. • Pattern Recognition: Recognizing regularities in data and using them efficiently. • Recurrent Neural Network: A type of neural network that identifies sequential patterns and makes sense of sequential information. • Supervised Learning: Output datasets provide machines with information on producing a desirable result/ algorithm. • Transfer Learning: A system that uses previously learned data to do a new set of tasks. • Unsupervised Learning: A machine learning technique where the model works independently to discover information. As the name suggests, no supervision is required. The most common supervised learning method is cluster analysis. 1 Machine Learning and Flow Assurance Issues 5 References 1. Bavoh CB, Lal B, Keong LK (2020) Introduction to gas hydrates. Chem Addit Gas Hydrates. https://doi.org/10.1007/978-3-030-30750-9_1 2. Theyab M, Theyab MA, Petroleum SJ, Muhammad *, Theyab A (2018) Fluid flow assurance issues: literature review fluid flow assurance issues: literature review view project scifed journal of petroleum fluid flow assurance issues: literature review. SciFed J Pet 3. Gao H (2022) Flow assurance overview and challenges in oil and gas production 4. Wang J, Zhou F, Zhang L, Huang Y, Yao E, Zhang L, Wang F, Fan F (2019) Experimental study of wax deposition pattern concerning deep condensate gas in Bozi block of Tarim oilfield and its application. Thermochim Acta 671:1–9 5. Yang J, Lu Y, Daraboina N, Sarica C (2020) Wax deposition mechanisms: is the current description sufficient? Fuel. https://doi.org/10.1016/j.fuel.2020.117937 6. Theyab MA (2018) Fluid flow assurance issues : literature review. SciFed J Pet 2:1–11 7. Mohammed I, Mahmoud M, Al Shehri D, El-Husseiny A, Alade O (2021) Asphaltene precipitation and deposition: a critical review. J Pet Sci Eng 197:107956 8. Olajire AA (2015) A review of oilfield scale management technology for oil and gas production. J Pet Sci Eng 135:723–737 9. Jamaluddin AKM, Kabir CS (2012) Flow assurance: managing flow dynamics and production chemistry. J Pet Sci Eng 100:106–116 10. B. Bavoh C, Ntow Ofei T, Lal B, (2020) investigating the potential cuttings transport behavior of ionic liquids in drilling mud in the presence of sII hydrates. Energy Fuels 34:2903–2915 11. Bavoh C, Nashed O, Rehman A, Othaman NA, Lal B, Sabil khalik Ionic liquids as gas hydrate thermodynamic inhibitors. Ind Eng Chem Res 60:15835–15873 12. Nissa Rehman A, B. Bavoh C, Pendyala R, Lal B, (2021) Research advances, maturation, and challenges of hydrate-based CO2 sequestration in porous media. ACS Sustain Chem Eng 9:15075–15108 13. Bavoh CB, Lal B, Osei H, Sabil KM, Mukhtar H (2019) A review on the role of amino acids in gas hydrate inhibition, CO2 capture and sequestration, and natural gas storage. J Nat Gas Sci Eng 64:52–71 14. Mohri M, Rostamizadeh A, Talwalkar A (2018) Foundations of machine learnin. MIT Press. https://doi.org/10.1007/s00362-019-01124-9 Chapter 2 Machine Learning in Oil and Gas Industry Jai Krishna Sahith Sayani and Bhajan Lal Abstract In the chapter, the use of machine learning in the oil and gas industry is briefly presented with emphases on the current trends in the oil and gas models. Also, the use of machine learning in the oil and gas upstream is discussed with highlights on the recent advancement on the use of AI in the oil and gas industry. The challenges facing the application of machine learning in the oil and gas industry is also presented. Keywords Machine learning · Artificial intelligence · Oil and gas industry · Upstream 2.1 Introduction The oil and gas industry is a massive business that includes upstream, midstream, and downstream sectors (Fig. 2.1). It is a difficult yet vital industry all over the world. It has a direct or indirect influence on our everyday lives by enabling services such as transportation, heating, and electricity, as well as various petrochemical products ranging from household items to clothing. It’s no surprise that petroleum is sometimes referred to as “black gold” because of its worth and value in human existence and the global economy [1]. At the moment, OGI organisations are looking at new methods to reduce operating costs, improve efficiency, and increase output. The challenges and dangers connected with activities and operations across the supply chain must be thoroughly handled, which necessitates the evolution of technology J. K. S. Sayani Department of Chemical and Bioprocess Engineering, University College Dublin (UCD), Dublin, Ireland B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_2 7 8 J. K. S. Sayani and B. Lal inside the OGI, particularly for data processing and administration. Digitalization of oil fields, real-time optimization of drilling operations, the use of nanotechnology, wireless sensor networks to improve gauging, reservoir modelling, and diagnostics are some examples of such technologies. According to industry research, there are enough resources available to sustain present oil production levels for at least another 50 years. Thus, the key problems that the OGI has are increasing productivity and delivering products to end customers at the lowest feasible cost. Given its worldwide character and the complexities of contracting with governments, joint ventures, and other stakeholders, the OGI also requires technology solutions for more effective data management [2]. Systems for oil field exploration, reservoir engineering, drilling, and production engineering are all part of the petroleum business. Other chemicals, such as prescription medications, solvents, fertilisers, insecticides, and polymers, are also powered by oil and gas [3]. If fossil fuel costs continue to climb, fossil fuel businesses will need to create new technologies and enhance operations in order to boost efficiency and build on current capabilities. However, as the oil fields age, they are now producing more water than oil due to waterfront arrival at shore, channeling, coning, or water breakthrough. This makes economically producing petroleum from the formation difficult. Fig. 2.1 Breakdown of oil and gas industry 2 Machine Learning in Oil and Gas Industry 9 Furthermore, because the price of oil has not yet stabilised, fairly expensive engineering or equipment is of little interest to any oil and gas corporation. The simplest way to conserve efficiency and productivity is to optimise cumulative extraction with effective and smart technology, such as Inflow Control Devices (ICD) or Inflow Control Valves (ICV) as well as downhole sensor systems. Improved control in huge oilfields necessitates quick decision-making while keeping continuing difficulties in mind. The Smart Oilfield will do this by constructing a comprehensive oilfield technological infrastructure through the digitization of instrumentation equipment and the creation of a network-based information exchange in order to improve the production process [4]. It has become abundantly evident that digital technology has a major impact on business and society. With the passage of time, it has become clear that digital transformation is now regarded as the “fourth industrial revolution,” characterised by the convergence of technologies that blur the boundaries between the physical, digital, and biological realms, such as artificial intelligence, robotics, and selfdriving vehicles. Artificial intelligence (AI) technologies are gaining popularity due to their quick response times and powerful potential for generalization [5]. Machine learning has shown promising results in helping and improving traditional reservoir engineering techniques in a wide spectrum of reservoir engineering difficulties [6]. Various research use advanced machine-learning methods for classification and regression issues, such as Fuzzy Logic (FL), Artificial Neural Networks (ANN), Supporting Vector Machines (SVM), and Response Surface Model (RSM) [7]. Several machine-learning methods utilised in reservoir engineering are within the supervised learning category. The majority of reservoir engineering implementations include evolutionary optimization approaches such as Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). The goal of the study should be to construct analytical processes by merging forward and reverse-looking AI models in order to predict the accurate solution of an inverse problem. Rana et al., for example, used forward-looking Gaussian proxy designs, Bayesian optimization, and numerical models of high-fidelity procedures to structure AI-assisted common platform workflows [8]. The new method is being used to address a problem with a coal seam degasification effort from the past. Bayesian optimization It may discover a variety of reservoir characteristic distribution solutions that suit the provided field data [9]. The authors also created a specialty approach based on ANN that uses field data from a part of the Marcellus shale gas field to help the history-matching method. It evaluated several hydraulic fracturing designs. Costa et al. employed ANN models and optimization programming to tackle a contextappropriate oilfield problem [10]. Throughout this method, forward-thinking ANN expertise systems are outfitted to replicate quantitative high-fidelity simulations in order to anticipate output data throughout the historical field period. Indeed, machine learning is employed in the petroleum business to investigate data-related issues. The educational programme was created to teach petroleum engineers via the use of machine learning algorithms and artificial intelligence tools. This gives suggestions for increasing productivity while lowering costs [3]. 10 J. K. S. Sayani and B. Lal The Gulf of Mexico oil and gas sectors have explored the impact of technology transition in oil and natural gas inspection using a specific collection of data types in a microstructured grid. The findings indicate that the technical shift with adaption of this technology has played a significant role in the offshore oil and gas business during the previous 50 years, with increased deposits and decreasing costs. Even while saturation impact remained important in the first two decades, its influence on technical advancement was adequate to compensate for the capital loss of more than 50 years of research [11]. Improving knowledge for future technological improvements through testing and innovation may result in improved predicting strategies for delivering oil and gas. Despite the fact that significant advances are possible, developers are testing field as well as regional-level systems to understand the consequences of changes in exploration technology. The progress of technology effects the discovery of new deposits, which are economically feasible sections of existing deposits, as well as the rental of capital; our research is critical for estimating mineral resources across the government revenue accounts [12]. Aside from technological advancements, certain circumstances may have a significant impact on the cost efficiency of the Clean Electricity Production from Offshore Natural Gas (CEPONG) framework [13]. Sami and Ibrahim investigated three different machine learning algorithms in order to anticipate multiphase flowing bottom hole pressure [14]. The model is constructed and tested using real-world data from an open literature collection. To evaluate the procedure accurately of the BHPs obtained using ML models and verify the work’s usefulness, a range of datasets were employed to check the correctness of the recommended models. Hazbeh et al. examined the precision and computational performance of machine learning techniques for rate of penetration in directional well drilling [15]. Hassanvand et al. estimated the rock uniaxial strength characteristics for an Iranina carbonate oil deposit using an artificial neural network [16]. Priyanka et al. did a review study on cloud computing-based smart grid technologies in the oil pipeline sensor network system [17]. The understanding of block chain technology in the oil and gas industry answers the opportunities, obstacles, risks, and developments that are analysed in this area. Block chain technology will provide several benefits to the whole oil and gas industry, including reduced payments and increased accountability and performance. The evolution of block chain technology in the oil and gas sector would then move to a modified block chain network, cross-chain, and modified smart contracts, as well as more interdisciplinary expertise [18, 19]. Casing drilling technology; modern innovations, enhanced oil recovery; synthetic, thermic, physical, and chemical techniques Microbial Enhanced Oil Recovery (MOER) and water alternating gas (WAG) processes are examples of technical changes brought about by the implementation of the block chain method in this sector. This Chapter describes cutting-edge research on the application of Machine Learning and AI approaches in the oil and gas upstream business. The primary goal of this article is to demonstrate the benefits of AI and machine learning approaches in various upstream areas. The study describes procedures that use machine learning and AI for effective computation and decision making based on a thorough understanding of this industry. This research examines how a handshake between the 2 Machine Learning in Oil and Gas Industry 11 petroleum industry and a numerical simulator with an intelligent system facilitates work and increases production. 2.2 Machine Learning in Upstream The term “upstream” refers to the production of crude oil and natural gas. It entails locating possible underground or underwater crude oil and natural gas deposits, drilling exploratory wells, and then drilling and operating the wells utilised to bring the crude oil or raw natural gas to the surface. The upstream segment is of special significance since it is the most capital-intensive and crucial of the three segments in the oil and gas industry. The increase in data processing capacities improves the performance of electronic gadgets. Computing power should be used for production and exploration in the oil and gas sectors [20]. Companies in this industry deal with large uncertainties that are managed manually and rely on specialist knowledge rather than real facts. The adage “one rock, two geologists, three viewpoints” encapsulates the enormous uncertainties and hazards that oil and gas firms face. When making multibillion-dollar decisions on where and how to spend over the next 5–20 years, the uncertainties must be addressed. Nonetheless, despite the sector’s complex and unpredictable management difficulties, single-criterion techniques have historically dominated decision-making [21]. To account for uncertainties associated with practitioners’ subjective perception and decision-making based on experience, the initial steps in employing artificial intelligence and machine learning, which are becoming increasingly popular, are made in the upstream. The report draws on findings from hundreds of AI initiatives completed with the authors’ assistance for top oil and gas upstream firms throughout the world over the previous three years. The programmes encompassed AI solutions for the whole spectrum of upstream activities, including reservoir geological evaluation, drilling optimization, reservoir engineering/field development, and production optimization. More information may be found in Table 2.1. The domination of “difficult-to-recover” oil and gas reserves during the last ten years necessitates new operational approaches and economic models in hydrocarbon exploration and production, aimed at assuring acceptable oil and gas production profitability. Both well-developed (brownfields) and recently discovered (greenfields) subterranean hydrocarbon reserves fall within this category. Despite the fact that the vast majority of brownfields are reasonably large geometrically and have adequate transport and storage qualities (porosity and permeability), the volume of oil and gas recoverable with cheap waterflooding is fairly little. All traditional brownfields, in theory, produce more water than oil. To maintain production levels, operators must spend enough money on one of the following operations: additional drilling, well treatment (e.g., hydraulic fracturing), or field-scale enhanced oil recovery procedures (e.g., increasing the mobility of remaining oil in the reservoir with chemical cocktails 12 J. K. S. Sayani and B. Lal Table 2.1 Non-confidential overview of projects completed with the authors’ direct involvement Upstream activity Developed tool Geological assessment A tool for automatically mapping reservoir rock parameters over an oil area AI approach Non gradient optimization + interpolation techniques Main effect Acceleration De-risking Speeded up the manual mapping procedure from several weeks to several seconds Removing human mistakes that cause incorrect mapping Means a more precise determination of the proper hydrocarbon targets Geological Gradient information may boosting be extracted from well records using this tool 100 + times speedup Rock typing software based on photographs of rock samples taken from wells ~1.000.000 + times speedup Deep neural networks Drilling Detects the kind Combination of of drilled rock machine learning and likely failure algorithms using real-time drilling telemetry Up to 20% time saving and up to 15% money savings at well construction Reservoir engineering A tool for speeding up traditional reservoir simulations Deep neural networks Accelerating by a Making it feasible factor of 200–2000 to filter through a significantly larger number of field development scenarios in order to find the best one Production optimization Data-driven technique for predicting the efficacy of well treatment initiatives objectively Gradient boosting + expert-based feature selection 100 + times faster estimation of the well treatment effect Increasing the amount of contact between the wellbore and the pay zone Up to a 20% increase in the marginality of campaign investments injection). In many situations, the money spent on these activities does not pay off, allowing brownfields to die slowly. The situation isn’t much better in terms of new discoveries. Almost all of the recently discovered hydrocarbon sources are difficult to access. It’s possible they’re [22]: • In harsh environments (e.g., the Arctic shelf) • Complex in geometry (e.g., thin and winding layers of oil-saturated rocks with many cracks) 2 Machine Learning in Oil and Gas Industry 13 • Under a thick layer of seawater and salt minerals (e.g., offshore Brazil) • Poor in permeability (so that the hydrocarbon is nearly immobile within the reservoir rock). The development of these greenfields necessitates costly technologies, putting the profitability of future oil production in jeopardy. Decision-makers manually and based on specialist knowledge, not actual data, handle uncertainties associated to long-term and high-value investments in the oil and gas upstream. In this situation, they must respond to two major questions. First and foremost, is this a unique asset perspective? Will we spend money on geophysical research to evaluate the asset’s potential? This topic is often answered through a geological modelling and reservoir modelling workflow, which can take anywhere from a few months to several years, depending on the need for further geophysical surveys and the complexity of in-house techniques. The second question is whether I should invest in increasing oil output at my asset. If that’s the case, which technologies are worth investing in? Experts are mostly in charge of this issue, and they are backed up by evidence. By using traditional reservoir modelling tools, we can get a good idea of how much water is in the reservoir. A strong reliance on professional opinion, as well as a lack of suitable input data for the traditional modelling techniques produce skewed and ambiguous results. AI systems that have been trained with the appropriate field data can help with both questions by speeding up the asset assessment process and making it more objective or expert independent. The next part discusses the first steps in this direction as well as future potential. 2.2.1 Exploration Exploration for hydrocarbons is fraught with danger. Explorationists must accurately identify subsurface potential in order to drill and utilise hydrocarbons. Limited 2D seismic data were used in the early twenty-first century to pinpoint drilling locations based on subsurface mapping. Because it is fraught with danger, the odds of success were 1:7. With the passage of time, new data was collected in each of the leases that were curved out for investigation. With advances in seismic and well data gathering, processing, and interpretation, this vast volume of data was dubbed “big data,” and it was stored in Terabytes of memory space. The machine learning idea was used to analyse the vast data. The goal of using big data and applying machine learning during collecting and processing is to enhance the signal to noise ratio. Using several robust methods, the clean data was used to interpret 2D, 3D, and 4D seismic. By combining well logging with accurate mapping of multiple subsurface horizons, an interpreter was able to prepare subsurface volume maps and turn them into amplitude, porosity, and saturation maps. To interpret the data parameters from the subsurface models, inversion techniques were used [22]. 14 J. K. S. Sayani and B. Lal Machine learning techniques assisted in the construction of horizon and window based features in order to grasp the sweet spots over time. Machine learning has produced new qualities such as coherency, edge map, spectral decomposition, and relief map. Understanding fault polygons, mapping complex fault structures, and facies mapping utilising striatal slicing increased subsurface prospect understanding. Prospects were converted into drillable prospects using machine learning algorithms, increasing the possibility of success to 1:3. The use of 4D seismic or repeat seismic assisted an interpreter in determining the hydrocarbon transport following drilling [23]. Artificial neural networks and heuristic methods are increasingly widely used to refine target prospects, their size, and hydrocarbon volume. Monte Carlo simulation and Evolutionary programming techniques are used to calculate a stochastic range of hydrocarbon in the subsurface and how much can be extracted and brought to the surface. In short, machine learning has ushered in a paradigm shift in India’s and the world’s exploration and production regimes. The use of AI in the oil and gas business is fast evolving, as the concept of AI pervades several stages of the industry, including intelligent drilling, intelligent development, intelligent pipelines, intelligent processing, and so on, and it will become a promising research path. Using artificial intelligence algorithms, developers have built a spectrum of realistic application technologies in research and production. Using artificial intelligence algorithms, developers have built a spectrum of realistic application technologies in research and production. The adoption of the ANN technique has already generated significant results in terms of minimising exploration risks and raising exploration well success rates in the field of exploration. Drilling quality has substantially increased and expenses have decreased because to new drilling equipment such as an automated drilling rig and an intelligent drill pipe. The most common use of AI technology in oilfield development is to refine the development plan based on past production data [24, 25]. A regression model can be used to investigate field planning and well site planning. Unsupervised learning can be used to understand data characteristics. Kumar et al., proposed a framework that was shown to be beneficial for shales due to its ability to manage massive amounts of data. The linearized rock physics inversion method can be used to tackle the problem of rock physics. Although this model can yield correct physical parameters, it is ineffective for highly nonlinearized rock physics. The suggested machine learning approach can generate accurate and cost-effective well logs, it can be concluded. When compared to the Long Short Term Memory Method, the Shift Window method can provide better pressure prediction (LSTM) [26, 27]. Diersen et al. employed artificial intelligence to reduce human effort in seismic whole wave tomography processing and analysis. This is accomplished through the use of artificial intelligence and the Complex Wavelet Transform (CWT). CWT is a wavelet-based transformation that aids in the understanding of waveforms’ time and frequency domains. Inside the full-wave tomography technique, an Artificial Neural Network and a Knowledge based Artificial Neural Network can be employed to pick suitable seismic window pieces [28]. 2 Machine Learning in Oil and Gas Industry 15 2.2.2 Reservoir Engineering Fluid flow through porous medium, production forecasts, and field optimization are all aspects of reservoir engineering. Preparing subsurface property maps and PVT analysis necessitates numerical simulations, modelling, and experiments. To prepare static and dynamic models, modelling is done on large amounts of data. For appraisal planning and stochastic field development plans, data from seismic, well log, core analysis, and past reservoir performance are combined using machine learning algorithms. Artificial Neural Network, Genetic Algorithm, Response Surface Model (RSM), and other algorithms are used to perform complex pressure transient analysis and deconvolution of pressure data. These GA models are highly useful for matching reservoir histories and preparing P90, P50, and P10 production profiles following Project Resource Management Systems principles (PRMS). Large amounts of data are used to create reservoir maps, which are refined repeatedly as new data is added to the database. For many years, ANN has been used to estimate reservoir parameters such as permeability and porosity. To forecast reservoir fluid properties, many machine learning approaches such as K Nearest Neighbours (KNN), Support Vector Regression (SVR), Kernel Ridge Regression (KRR), Adaptive Boosting, and Collaborative Filtering can be used. Onwuchekwa discovered that collaborative filtering, which was originally built for a consumer product recommendation system, worked well in their reservoir study [29]. The synthetic reservoir model can be used to simulate reservoir oil numerically. Teixeira and Secchi employed an optimization technique to find the best control for increasing total oil production [30]. The parametric study compares different machine learning algorithms for predicting permeability, seismic characteristics, and wireline data. In terms of permeability prediction, the Superior Vector Mechanism (SVM) outperformed other approaches. Anifowose et al., developed an intelligent model based on injector wells that used the Extreme Gradient Boosting method to forecast reservoir response. In a heterogeneous reservoir with complex topography, Nwachukwu et al. chose five cases: homogeneous reservoir water flood, channelized reservoir water flood, 20-model ensemble water flood, and CO2 flood [31]. 2.2.3 Drilling Engineering Drilling has a number of issues, including stick sleep vibrations, loss of circulation, bit wear, excessive torque, borehole instability, and so on. Machine learning has the ability to solve these issues [32]. Aliouane and Ouadfeul suggested a machine learning approach for generating a poisson’s ratio map, which is beneficial for determining drilling direction and rock features [33]. Castineria et al. used the machine learning method to verify the quality of huge drilling data, retrieve critical information, and anticipate non-productive time [34]. This strategy saved money by reducing 16 J. K. S. Sayani and B. Lal the amount of time it took to assess the quality of vast amounts of drilling data. The Byesian network (BN) can be used for Managed Pressure Drilling (MPD) and Under Balanced Drilling (UBD) operations in deep sea drilling. According to Bhandari et al., the BN may be utilised efficiently for risk analysis and failure prediction in the offshore business [35]. Automation was used to control drilling parameters such as the Weight of Bit (WOB), Rotary Speed (RPM), and Rate of Penetration (ROP). A machine learning method can collect information such as alternative bit or rig equipment upgrades, estimated abrasive wear, and predicted bit wear [36]. 2.2.4 Production Engineering The use of advanced machine learning technologies results in a revolutionary workflow that relieves the burden on engineers. In the oil and gas industry, machine learning has a variety of applications in production engineering. One of the most difficult tasks is analyzing massive amounts of data in a short amount of time in order to make decisions. Machine learning technologies can be used to recognize production patterns in data. With active learning, Subrahmanya et al. were able to obtain the data point with the maximum information value. With semi-supervised learning, data from wells was integrated from labelled and unlabeled sources. Algorithms were used to check, verify, and recover the data. The study looked at well logging data rectification, quality control of physical and chemical fluid parameters, and separation between base production and well interventions [37, 38]. With the help of data patterns, the ANN model can forecast closure pressure. To reduce mistake, the output data is usually compared to the real outcomes. According to Nande, an ANN model is capable of accurately predicting closure pressure [39]. Shen et al. employed the Support Vector Regression Model to forecast wrinkling in mechanically lined pipelines [40]. The importance of edge analytics for the oil and gas industries was explained by Saghir et al. For electric submersible pump driven wells, edge analytics was used to detect anomalies in real time [41]. Another key use in the oil and gas business is the Continuous Integration/Continuous Deployment (CICD) methods in machine learning. An advanced CICD should contain a precise and repeatable Machine Learning (ML) workflow with tracking, model lineage, and version control systems. This is especially useful in recognizing conceptual drift, which occurs when the performance of a statistical model degrades over time due to changes in data and previously modelled input– output relationships [42]. Another key use in the oil and gas business is the Continuous Integration/Continuous Deployment (CICD) methods in machine learning. An advanced CICD should contain a precise and repeatable Machine Learning (ML) workflow with tracking, model lineage, and version control systems. This is especially useful in recognizing conceptual drift, which occurs when the performance of a statistical model degrades over time due to changes in data and previously modelled input–output relationships. By employing LiDAR to create 3D point clouds and 2 Machine Learning in Oil and Gas Industry 17 analytics for plant building, experts can predict the behavior of a structure and calculate its maintenance needs, considerably prolonging its lifetime. These simulations, on the other hand, are fairly “static,” in the sense that they don’t account for all of the changes in an asset’s actual, real-world physical variables that can affect its performance over time. To combine data from IIoT sensors concerning actual environmental loads with a virtual duplicate of the asset, new control methods have been developed. 2.3 Machine Learning Advancements in the Oil and Gas Industry Companies are actively pursuing creative techniques to be more efficient through simplifying production, cutting costs, and enhancing worker safety, among other things, as the oil and gas business grows more competitive and unpredictable. Many CEOs are turning to digitization to protect businesses from market shocks, stay profitable at reduced oil prices, and gain a competitive edge during the rebound. Artificial intelligence (AI) and machine learning-based technologies, which are rapidly maturing and being deployed across the value chain, are the way forward. Numerous sectors have recognised the advantages of these new technologies, and we will continue to see more AI applications created in the future. Let’s look at some real-life AI applications in the oil and gas sector. 2.3.1 Total S.A. With Google Cloud–Optimize Subsurface Data Analysis Before and after drilling into the Earth, oil and gas companies must collect and analyse a large amount of data. They need to be able to solve complicated exploration and production challenges before they waste money drilling into an unproductive well to increase efficiency in day-to-day operations. In 2018, Total S.A., a French oil and gas firm, teamed up with Google Cloud to create AI solutions that improve subsurface data processing for exploration and production. If you go back a few decades, you’ll see that Total is no stranger to AI implementation. In the 1990s, the business began using AI and machine learning algorithms to describe oil and gas areas. In 2013, they deployed predictive maintenance technologies for turbines, pumps, and compressors, which resulted in hundreds of millions of dollars in savings. With Google Cloud, they’re taking it to the next level. Their combined technologies will make it possible to use computer vision to understand subsurface images from seismic studies. Furthermore, their AI solutions will use natural language processing to automate the study of technical texts. Total will be able to explore and analyse oil and gas areas significantly faster and more effectively as a result of these solutions. 18 J. K. S. Sayani and B. Lal 2.3.2 ExxonMobil and MIT Collaborate to Detect Oil Seeps with AI-Powered Robots ExxonMobil is one of the most well-known oil and gas companies in the world. They also put their money into some interesting AI projects. The industry behemoth partnered up with the Massachusetts Institute of Technology (MIT) in 2016 to develop artificial intelligence (AI) robots for ocean research. One of the major members of this deep-sea endeavour is Brian Williams, an MIT professor and a core designer of the software for NASA’s Mars Curiosity Rover, adding to the cool factor. ExxonMobil intends to employ this deep-sea AI robot to improve its natural seep detection capabilities. Natural oil seeps from the bottom are the most common source of oil into the world’s oceans, accounting for over half of all oil discharged each year, according to the National Oceanic and Atmospheric Administration. ExxonMobil’s AI-powered robots will be able to detect these oil seeps, reducing the risk of exploration and minimising the impact on marine life. Researchers and engineers from ExxonMobil are partnering with MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) to build self-learning, submersible artificial intelligence robots for ocean subsurface exploration. The robots’ programming, or “intelligence,” will allow them to perform independently in severe environments like those encountered on Mars, as well as modify mission parameters on their own to examine unforeseen anomalies. Observing the waters, charting deep areas, researching how they evolve over time, and assessing their state would be a promising application for the new technology. 2.3.3 Shell—Machine Learning Algorithms for Precision Drilling Shell is another corporate behemoth that is experimenting with AI applications. Shell is utilising reinforcement learning to operate its drilling equipment this time around, effectively implementing a reward system based on the AI’s decisions. For example, to drive the drill into the subsurface, a machine learning model is trained on historical data from Shell’s comprehensive drilling records, as well as simulations. It also considers data from seismic surveys, as well as temperature, pressure, and other drill bit data points. The geosteerer, or the person running the drilling machine, can then provide feedback via reward or punishment functions, allowing the machinery to adjust to changing subsurface conditions. This allows the geosteerer to have a greater understanding of the area in which they are working, resulting in faster, more precise results and fewer machinery damage. However, innovation does not end there. Shell is continuously on the lookout for major ideas that will push the oil and gas industry’s boundaries. Shell conducts regular calls for AI proposals centred on machine learning from people and startups all across the world through their Shell Game Changer project. Shell is leading 2 Machine Learning in Oil and Gas Industry 19 the way in helping to tackle some of the industry’s biggest difficulties, whether it’s investing in these ideas or simply partnering on a project. However, innovation does not end there. Shell is continuously on the lookout for major ideas that will push the oil and gas industry’s boundaries. Shell conducts regular calls for AI proposals centred on machine learning from people and startups all across the world through their Shell Game Changer project. Shell is leading the way in helping to tackle some of the industry’s biggest difficulties, whether it’s investing in these ideas or simply partnering on a project. Algorithms for guiding drills through the subsurface are being created utilising data from Shell’s drilling history as well as data from simulated investigations. Mechanical data from the drill bit, such as pressures and temperatures, are included, as well as data from subsurface seismic research. As a result, a Shell geosteerer, the drilling machine’s human programmer, is capable of comprehending the circumstances in which they are working, resulting in faster results and less wear and tear on machinery. 2.3.4 Aker BP and Spark Cognition—Predictive Maintenance Increases Productivity Unplanned downtime can be a costly nightmare for offshore oil and gas platforms, with catastrophic asset breakdowns costing as much as $2e3 million in a single day. Too many businesses still rely on antiquated ways, causing some to place a greater emphasis on data and analytics when making maintenance choices. Aker BP, a Norwegian independent upstream oil and gas firm, teamed with Spark Cognition to implement an AI-powered predictive maintenance solution to their unmanned Tambar platform, where problems with a crucial multi-phase pump cause a large amount of unplanned downtime. Spark Cognition built and integrated a multi-phase pump normal behaviour model into its AI-powered predictive maintenance software, which subsequently flagged deviations from normal subsystem behaviour. The AI programme notified Aker BP operators and SMEs to a probable multi-phase pump trip caused by a deteriorating seal over the course of six months, with previous failures costing over $10 million in lost production. Aker BP and Spark Cognition were able to avert pump failure, resulting in hundreds of thousands of dollars in additional production for each day of downtime avoided. Spark Cognition built and integrated a multi-phase pump normal behaviour model into its AI-powered predictive maintenance software, which subsequently flagged deviations from normal subsystem behaviour. The AI programme notified Aker BP operators and SMEs to a probable multi-phase pump trip caused by a deteriorating seal over the course of six months, with previous failures costing over $10 million in lost production. Aker BP and Spark Cognition were able to avert pump failure, resulting in hundreds of thousands of dollars in additional production for each day of downtime avoided. SparkPredict uses machine learning techniques to analyse 20 J. K. S. Sayani and B. Lal sensor data in order to detect inefficient processes and impending issues before they occur. Installing SparkPredict on Aker BP’s offshore production platforms will boost productivity and efficiency, furthering the company’s goal of providing unrivalled value to its clients around the world. 2.4 Challenges Companies To reduce uncertainty, the first step is to develop a system that can handle multiple hypotheses in order to arrive at an optimal solution. Anifowose et al. developed an effective AI and machine learning technique to tackle this challenge. Hybrid Intelligent System (HIS) was created to address this issue in machine learning. It had been demonstrated that the HIS has enormous potential for improving oil field reserve estimates, resulting in better finding, considerably more efficient extraction, wider development, and highly productive use of energy supplies [43]. Given the current state of the oil industry, machine learning appears to have become more widely used in the previous five years, particularly in the alleviation of drilling issues in real time, as well as in oil drilling automation and technology. Machine learning has also shown promise in achieving higher rates of penetration (ROP) and lower CPF levels, as well as many other performance metrics like drilling 10,000 m per day [32]. Hawedi et al. proposed a data-driven framework for evaluating well performance in two scenarios: predicting only current well performance and forecasting future well performance [44]. The entire method is much more detailed than the step-by-step regression evaluation in that it includes additional data sources such as geological map details, output restrictions such as tube head pressure, and positions that represent dynamic reservoir characterisation of non-traditional wells without requiring a current model [45]. Machine learning (ML) will significantly improve oil exploration and interpretation of seismic data, as well as develop extraction strategies to make it more efficient. The biggest issue confronting the oil industry today is the environmental risk associated with both oil extraction and production. However, the goal is that other systems will be constructed using modern technical approaches that are considerably more environmentally sustainable. Although the Artificial Neuro Fuzzy Inference System (ANFIS) improves performance slightly, the prediction is not necessarily changed when ANN is used because the neural network is already capable of providing a genuine working formula [46]. While certain oil and gas firms, such as ONGC, OIL, Reliance, and Shell, are accelerating their AI activities by investing heavily in startups and R&D, many obstacles are keeping them from implementing AI in the exploration and production of oil and gas on a large scale and quickly. This isn’t a problem exclusive to the oil and gas industry; it’s a regular occurrence in the early stages of AI’s development. The main problems, according to studies, are related to the type of people the sector requires, the value of data, and the necessity for open communication. These three difficulties will be explained further down. 2 Machine Learning in Oil and Gas Industry 21 2.4.1 Manpower Artificial intelligence’s success is inextricably linked to human intelligence. AI solutions aren’t general, and they can’t be purchased off the shelf. Even when produced by third parties, AI solutions must be tailored to a company’s business context and database. Companies must build in-house teams of data and AI specialists to actively use AI in processes and products. These groups should be able to assist in the development of AI infrastructure (algorithms and datasets) and, at the very least, customise tools that businesses will use in the future. That means that, in the next ten years, oil and gas companies will become (partially) data-driven, and AI specialists will become indispensable in supporting practically all innovation efforts in the industry. Finding and keeping AI talent, on the other hand, is a difficult undertaking. There is a severe scarcity of AI talent on the employment market, and with more corporations investing in AI and developing their own AI departments, the outlook for the next decade is bleak. This is particularly true for oil and gas firms. Next, in order to compete with tech giants like Google, Yandex, IBM, and Amazon for the same talent, oil and gas businesses must combat negative opinions regarding fossil fuel industries by partnering with great institutions and cool startups throughout the world. That is neither a simple nor a cheap task. Despite the fact that AI’s entry into the oil and gas business heralds “the end of petroleum engineering as we know it,” petroleum engineers will not vanish. The only thing that will change is their function and the ability that will be needed of them. To succeed in the AI era, oil and gas firms will need petroleum engineers with a good understanding of data science and the capacity to identify and design jobs that can be addressed by AI, in addition to data scientists. Their job will be to make sure that the relevant challenges for AI are recognised, that the right data is collected, and that solutions are tailored to the physical and process realities. This will become increasingly important over time, as otherwise, the wrong questions may be asked, and existing human errors may be compounded, as was the case with Google’s mammogram-based breast cancer screening system. As a result of the use of AI, it is not simply data science and AI skills that are in need, but a new way of thinking about the difficulties that oil and gas firms face, anchored in a thorough grasp of the processes and the underlying logic of activities. As a result, petroleum engineers’ new job will become increasingly important. Some universities, such as Russia’s Skolkovo Institute of Science and Technology and the United States’ West Virginia University, have already begun to implement specific educational programmes that combine data science with petroleum studies to prepare the future generation of petroleum engineers. Petroleum engineers will need to learn how to interact with AI assistants, which are akin to Alexa and Siri but focused on industry applications, in addition to working with data and data scientists. The goal in these new partnerships will be to combine the best of both sides’ capabilities: AI’s capacity to deal with large amounts of data, detect patterns and relationships, and petroleum engineers’ deep industrial domain knowledge. Although AI is projected to mostly be utilised by humans to supplement 22 J. K. S. Sayani and B. Lal rather than replace their decision-making abilities, this will be a difficult undertaking because numerous questions about trust and the fear of losing jobs may arise. There is also an unresolved issue with people’s legal perspectives on AI’s recommendations. There may be instances where an AI tool proposes a course of action that results in a loss of money, output, or even serious health or environmental problems. In this instance, there is no clear understanding of who is responsible for what: the AI algorithm, the AI algorithm user, or the AI algorithm developer. With the advancement of AI capabilities, this subject will become increasingly relevant. As a result, the legal foundation will be established in simultaneously. According to the practise, the algorithms and their developers are not liable, but the decisionmakers who receive advise from AI and AI users bear accountability. As a result, in order to take advantage of the chance to greatly expand decision-making capabilities, businesses will need to develop not just AI strategies, but AI strategies as well. 2.4.2 Data Availability To be taught and subsequently perform successfully in the operational mode, AI systems require high-quality data in a sufficient volume. While smarter algorithms may aid in obtaining better results from datasets of restricted size, there is no way to improve faulty data. As a result, access to large amounts of high-quality data is both an advantage and a barrier to the development of AI applications. Large volumes of raw data are generated in oil and gas sectors. Even said, there are acknowledged challenges with the quality and accuracy of field data, as well as a general shortage of huge volumes of labelled data in the oil and gas business, so it is not a guarantee of success. Training datasets must be properly acquired over the course of a multiyear procedure that follows a well-planned methodology and is situation-specific. Oil and gas firms will have to adapt and adjust their organisational structures and procedures to increase the value of the data they have or can access. Technical efforts in enhancing AI systems and their subsequent practical use in oil and gas exploration and production are driven by data difficulties (across industries, not only in the oil and gas industry). 2.4.3 Opportunities and Facilities for Collaboration Artificial intelligence emerges in an open and collaborative environment as a result of academia’s decades of leadership in AI research, almost free of commercial influences. This spawned a culture of open sharing and publishing, which businesses from all industries (and all corners of the globe) were forced to adopt as a standard in order to compete in the AI era. While open innovation is becoming the norm in the digital industry, oil and gas corporations aren’t known for their collaborative industry projects, especially between competitors and especially in crucial fields like 2 Machine Learning in Oil and Gas Industry 23 artificial intelligence. Despite the fact that many organisations have announced the open-source of some of their data and assert the importance of cross-company and cross-border data exchange, the reality is currently negative. The oil and gas industry in the United Kingdom One of the first significant open data releases in the oil and gas industry was the National Data Repository. It holds 130 gigabytes of geophysical, infrastructure, field, and well data, with approximately 12,500 wellbores, 5000 seismic surveys, and 3000 pipelines represented (Oil and Gas Authority, 2019). On the basis of accessible data, potential for machine learning and artificial intelligence applications are outlined. Oil and gas firms should reconsider their methods for partnering and interacting with universities because university labs are another significant source of novel AI technology and AI skills. 2.5 COVID-19’s Impact on the Oil and Gas Industry, and AI as a Solution Companies Lower crude prices and geopolitical difficulties are resulting in excess supply and some major industry advances as the oil and gas sector enters a new normal of pandemic condition. Despite the fact that consumption is likely to rise as the world recovers from the epidemic and normalises its relations and output quotas, industry participants must be flexible enough to adjust to the new reality. They need to focus on strengthening their supply chain and activities in order to reduce manufacturing, distribution, and transportation expenses. Artificial intelligence (AI) has the potential to transform the value chain in the oil and gas industry. Artificial intelligence (AI) models are frequently used as isolated point solutions with little overall benefit. As benefits begin to plateau fast, dissatisfaction with performance has an impact on future plans. As it incorporates crossdomain data, the industry continues to focus on different aspects of reservoir, geology, geophysics, engineering, and drilling. With a single staff in charge of all geotechnical needs, these divisions were developed to boost productivity across the organisation. This operational division, which was established in the past to meet cost-cutting requirements, precludes the oil and gas industry from implementing broader cross-functional AI applications. 2.6 Summary This chapter presents examples of machine learning applications in exploration, reservoir, drilling, and production. The oil and gas business, according to the literature analysis, is well-positioned to gain from machine learning because of its ability 24 J. K. S. Sayani and B. Lal to process large amounts of data quickly. Throughout this work, a variety of monitored learning approaches have been defined and described. Machine learning has the ability to fundamentally alter the myriad vital decisions made by administrators and engineers in the oil and gas industry on a daily basis. If proper approaches are employed to incorporate diverse data kinds or structures and convert them into valuable information that leads to intelligent judgments, the future benefits of information can be realised. Many of these methods, which use ANN, ALM, supervised learning, fuzzy logic, linear regression, and PCA, may be implemented to address numerous challenges in the oil and gas industry and aid in the development of successful strategies. Machine learning’s use is expected to grow fast in the future years, and its worth will be widely recognised in the oil and gas industries. References 1. Lalude G (2015) Importance of oil to the global community. Glob J Human-Soc Sci F Polit Sci 15 2. Fjellheim RA (2020) Autonomous systems - opportunities and challenges for the oil & gas industry a white paper authored by the autonomy working group of norsk forening for automatisering (Norwegian Society of Automatic Control ) 3. Anderson RN (2017) “Petroleum analytics learning machine” for optimizing the Internet of Things of today’s digital oil field-to-refinery petroleum system. In: Proceedings of the - 2017 IEEE International Conference Big Data, Big Data 2017 2018, pp 4542–4545 4. Temizel C, Canbaz CH, Palabiyik Y, Putra D, Asena A, Ranjith R, Jongkittinarukorn K (2019) A comprehensive review of smart/intelligent oilfield technologies and applications in the oil and gas industry. SPE Middle East Oil Gas Show Conf. https://doi.org/10.2118/195095-MS 5. Evans SJ (2019) How digital engineering and cross-industry knowledge transfer is reducing project execution risks in oil and gas. Offshore Technol Conf. https://doi.org/10.4043/294 58-MS 6. Anifowose FA, Labadin J, Abdulraheem A (2017) Ensemble machine learning: an untapped modeling paradigm for petroleum reservoir characterization. J Pet Sci Eng 151:480–487 7. Ani M, Oluyemi G, Petrovski A, Rezaei-Gomari S (2016) Reservoir uncertainty analysis: the trends from probability to algorithms and machine learning. SPE Intell Energy Int Conf Exhib. https://doi.org/10.2118/181049-MS 8. Rana S, Ertekin T, King GR (2018) An efficient probabilistic assisted history matching tool using Gaussian processes proxy models: application to coalbed methane reservoir. SPE Annu Tech Conf Exhib. https://doi.org/10.2118/191655-MS 9. Esmaili S, Mohaghegh SD (2016) Full field reservoir modeling of shale assets using advanced data-driven analytics. Geosci Front 7:11–20 10. Costa LAN, Maschio C, José Schiozer D (2014) Application of artificial neural networks in a history matching process. J Pet Sci Eng 123:30–45 11. Managi S, Opaluch JJ, Jin D, Grigalunas TA (2005) Technological change and petroleum exploration in the Gulf of Mexico. Energy Policy 33:619–632 12. Adelman MA (1991) User cost in oil production. Resour Energy 13:217–240 13. Roussanaly S, Aasen A, Anantharaman R et al (2019) Offshore power generation with carbon capture and storage to decarbonise mainland electricity and offshore oil and gas installations: A techno-economic analysis. Appl Energy 233–234:478–494 14. Sami N, Aziz A (2021) Machine learning and big data: an approach toward better healthcare services. Comput Intell Healthc Inform 1–13 2 Machine Learning in Oil and Gas Industry 25 15. Hazbeh O, Aghdam SK, ye, Ghorbani H, Mohamadian N, Ahmadi Alvar M, Moghadasi J, (2021) Comparison of accuracy and computational performance between the machine learning algorithms for rate of penetration in directional drilling well. Pet Res 6:271–282 16. Hassanvand M, Moradi S, Fattahi M, Zargar G, Kamari M (2018) Estimation of rock uniaxial compressive strength for an Iranian carbonate oil reservoir: modeling versus artificial neural network application. Pet Res 3:336–345 17. Priyanka EB, Thangavel S, Gao X-Z (2021) Review analysis on cloud computing based smart grid technology in the oil pipeline sensor network system. Pet Res 6:77–90 18. Zheng L, Wei P, Zhang Z, Nie S, Lou X, Cui K, Fu Y (2017) Joint exploration and development: A self-salvation road to sustainable development of unconventional oil and gas resources. Nat Gas Ind B 4:477–490 19. Lu H, Huang K, Azimi M, Guo L (2019) Blockchain technology in the oil and gas industry: a review of applications, opportunities, challenges, and risks. IEEE Access 7:41426–41444 20. Shafiee M, Animah I, Alkali B, Baglee D (2019) Decision support methods and applications in the upstream oil and gas sector. J Pet Sci Eng 173:1173–1186 21. Strantzali E, Aravossis K (2016) Decision making in renewable energy investments: a review. Renew Sustain Energy Rev 55:885–898 22. Zhang J, Yin X, Zhang G, Gu Y, FAN X, (2020) Prediction method of physical parameters based on linearized rock physics inversion. Pet Explor Dev 47:59–67 23. Kumar A (2019) A machine learning application for field planning. Offshore Technol Conf. https://doi.org/10.4043/29224-MS 24. Holditch SA (2013) Unconventional oil and gas resource development–let’s do it right. J Unconv Oil Gas Resour 1–2:2–8 25. Pandey RK, Kakati H, Mandal A (2017) Thermodynamic modeling of equilibrium conditions of CH4/CO2/N2 clathrate hydrate in presence of aqueous solution of sodium chloride inhibitor. Pet Sci Technol 35:947–954 26. Zhang D, Chen Y, MENG J, (2018) Synthetic well logs generation via recurrent neural networks. Pet Explor Dev 45:629–639 27. Heghedus C, Shchipanov A, Rong C (2019) Advancing deep learning to improve upstream petroleum monitoring. IEEE Access 7:106248–106259 28. Diersen S, Lee EJ, Spears D, Chen P, Wang L (2011) Classification of seismic windows using artificial neural networks. Proc Comput Sci 4:1572–1581 29. Onwuchekwa C (2018) Application of machine learning ideas to reservoir fluid properties estimation. SPE Niger Annu Int Conf Exhib. https://doi.org/10.2118/193461-MS 30. Teixeira AF, Secchi AR (2019) Machine learning models to support reservoir production optimization. IFAC-PapersOnLine 52:498–501 31. Nwachukwu A, Jeong H, Pyrcz M, Lake LW (2018) Fast evaluation of well placements in heterogeneous reservoir models using machine learning. J Pet Sci Eng 163:463–475 32. Noshi CI, Schubert JJ (2018) The role of machine learning in drilling operations; a review. SPE/AAPG East Reg Meet. https://doi.org/10.2118/191823-18ERM-MS 33. Aliouane L, Ouadfeul S-A (2014) Sweet spots discrimination in shale gas reservoirs using seismic and well-logs data. A case study from the worth basin in the Barnett shale. Energy Procedia 59:22–27 34. Castiñeira D, Toronyi R, Saleri N (2018) Machine learning and natural language processing for automated analysis of drilling and completion data. SPE Kingdom Saudi Arab Annu Tech Symp Exhib. https://doi.org/10.2118/192280-MS 35. Bhandari J, Abbassi R, Garaniya V, Khan F (2015) Risk analysis of deepwater drilling operations using Bayesian network. J Loss Prev Process Ind 38:11–23 36. Dunlop J, Isangulov R, Aldred WD, Sanchez HA, Flores JL, Herdoiza JA, Belaskie J, Luppens JC (2011) Increased rate of penetration through automation. SPE/IADC Drill Conf Exhib. https://doi.org/10.2118/139897-MS 37. Subrahmanya N, Xu P, El-Bakry A, Reynolds C (2014) Advanced machine learning methods for production data pattern recognition. SPE Intell Energy Conf Exhib. https://doi.org/10.2118/ 167839-MS 26 J. K. S. Sayani and B. Lal 38. Andrianova A, Simonov M, Perets D, Margarit A, Serebryakova D, Bogdanov Y, Budennyy S, Volkov N, Tsanda A, Bukharev A (2018) Application of machine learning for oilfield data quality improvement. SPE Russ Pet Technol Conf. https://doi.org/10.2118/191601-18R PTC-MS 39. Nande S (2018) Application of machine learning for closure pressure determination. SPE Annu Tech Conf Exhib. https://doi.org/10.2118/194042-STU 40. Shen C, Fournier B, Giry E, Cocault-Duverger V (2019) Lined pipe reeling mechanics design of experiment and; machine learning model. 29th Int. Ocean Polar Eng. Conf. 41. Saghir F, Gilabert H, Boujonnier M (2018) Edge analytics and future of upstream automation. SPE Asia Pacific Oil Gas Conf Exhib. https://doi.org/10.2118/192019-MS 42. Žliobaitė I, Pechenizkiy M, Gama J (2016) An overview of concept drift applications BT - big data analysis: new algorithms for a new society. In: Stefanowski J (ed) Japkowicz N. Springer International Publishing, Cham, pp 91–114 43. Anifowose FA, Labadin J, Abdulraheem A (2017) Hybrid intelligent systems in petroleum reservoir characterization and modeling: the journey so far and the challenges ahead. J Pet Explor Prod Technol 7:251–263 44. Hawedi HS, Haron H, Nordin A, Ahmed AA (2011) Current challenges and future perspective: the influence of organizational intelligence on libyan oil and gas industry. IJCSNS Int J Comput Sci Netw Secur 11(1):145–147 45. Cao Q, Banerjee R, Gupta S, Li J, Zhou W, Jeyachandra B (2016) Data driven production forecasting using machine learning. SPE Argentina Explor Prod Unconv Resour Symp. https:// doi.org/10.2118/180984-MS 46. Khan MA, Al-Oufi M, Toseef A, Nadeem MA, Idriss H (2018) Comparing the reaction rates of plasmonic (Gold) and non-plasmonic (Palladium) metal particles in photocatalytic hydrogen production. Catal Lett 148:1–10 Chapter 3 Multiphase Flow Systems and Potential of Machine Learning Approaches in Cutting Transport and Liquid Loading Scenarios Muhammad Saad Khan, Abinash Barooah, Bhajan Lal, and Mohammad Azizur Rahman Abstract Multiphase flow is a primary concern in flow assurance applications, mainly dealing with cutting transport, hydrate formation, and liquid loading issues. The conventional prediction model includes empirical equations and complex physics-based models; however, they are limited within the experimental ranges. Due to complex physics and the limitations of numerical methods, new techniques of collecting and evaluating multiphase behavior in these pipelines is essential, which is reviewed in this chapter. The review covers the overview of different multiphase systems, followed by cutting transport and existing models for accurate prediction of cutting transport. Also, the available literature on machine learning applications in cutting transport is included in it. Moreover, the chapter also demonstrates a liquid loading issue and their available prediction methods. The available literature on machine learning in liquid loading applications is also part of this chapter. The final part of the chapter includes the case studies of machine learning in multiphase flow systems to provide the field applicability of this modern prediction technique which can provide an avenue for future applications. Keywords Cutting transport · Flow regime maps · Liquid loading · Machine learning · Multiphase flow M. S. Khan · B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia A. Barooah Petroleum Engineering Department, Texas A&M University, College Station, USA M. A. Rahman Petroleum Engineering Department, Texas A&M University at Qatar, Ar-Rayyan, Qatar © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_3 27 28 M. S. Khan et al. 3.1 Introduction to Multiphase Two-phase flow is the interaction of two distinct phases in a channel that share common interfaces, with each phase representing a mass or volume of matter. Both phases are capable of coexisting as solids, gases, or liquids. Although three-phase multiphase flow occurs, the bulk of multiphase engineering applications uses a twophase flow. Planning, development, and optimization are required for flow in any channel. Based on the interfaces generated between the phases, predicting the flow phases and flow regimes is critical, i.e., typical flow patterns. Based on the flow rate, channel size, and operating conditions, this knowledge allows for predicting pressure drop and heat transfer characteristics. The appropriate flow parameters can be determined based on the pressure drop data to reduce the occurrence of corrosion, erosion, or scale development, all of which can lead to excessive friction. Predicting flow regimes, such as oil and gas flow in pipelines or chemical process industries, allows avoiding excessive gas pressure buildup, meltdowns, and potentially hazardous explosions. The results of heat transfer analysis can be utilized to design flow channels and operating conditions and forecast and avoid flow instabilities. The heat transfer community and practicing engineers are predominantly interested in two-phase flow, which involves phase transition between a single substance’s liquid and vapor phases. Two-phase flow refers to the fluid flow of a two-phase mixture, which can be (1) liquid–vapor flow, (2) liquid–liquid, (3) liquid–solid particles, or (4) gas–solid particles. This category includes forced convective condensation and boiling. Solving two-phase flow and heat transfer problems is extremely difficult because each phase has its own properties, velocity, and temperature. The conveyance of multiphase well fluids is extremely prevalent in the oil industry. When the fluid from an oil and gas well reaches the wellhead, it forms a three-phase (oil, water, and gas) or two-phase (oil and gas) mixture. A single-phase liquid or gas flow at the wellhead is an extreme example. The multiphase fluid flow analysis is used to mimic the behavior and interactions of two fluid phases. The study uses the Volume of Fluid (VoF) method, a typical multiphase system computing method. Because of the variety in flow regimes, multiphase flow is substantially more difficult than single-phase flow (or flow patterns). Fluid distribution varies dramatically throughout flow regimes, influencing pressure gradients inside and outside the drill string. 3.1.1 Gas–Liquid Flow Systems Gas–liquid systems are often encountered in gas wells where produced water increases with increased production, causing serious production threats like hydrate formations [1–9] and liquid loading [10–13]. Flow Regime maps are handy tools for understanding the flow behavior that might be expected for a given set of input data. Each map, however, is not broad enough to apply to other data sets. It describes the 3 Multiphase Flow Systems and Potential of Machine Learning … 29 geometrical distribution of a multiphase fluid passing through a pipe. This distribution is described using various flow regimes, distinguishing between qualitative and somewhat arbitrary. The flow mapping or flow analysis indicates the onsite visualization of fluid flow behavior encountered mainly in production lines is gas–liquid, which is depicted in Fig. 3.1. The significant gas–liquid flow regimes in a horizontal annulus can be described as the bubbly flow, plug flow, slug flow, wavy flow, and annular flow with the increased flow rates of gases phase (see Fig. 3.1). Fig. 3.1 Gas–liquid flow regimes orientation in the horizontal annulus: a Schematic b pictorial 30 M. S. Khan et al. 3.1.2 Liquid–Liquid Flow Systems Many engineering applications accurately predict oil–water flow properties such as flow pattern, water holdup, and pressure gradient. Flows of two immiscible liquids occur in a wide variety of processes and equipment. Oil and water combinations are delivered through pipes across great distances via pipelines [14–16]. Despite their importance, liquid–liquid fluxes have not been studied as thoroughly as gas–liquid flows. In fact, gas–liquid systems are a subset of two-fluid systems distinguished by a low density to viscosity ratio. The density difference between the phases in liquid–liquid systems is quite small (Fig. 3.2). 3.1.3 Solid–Liquid Flow Systems Solid–liquid flows, which are generally encountered during the drilling operation, require effective cutting transport for effective hole cleaning [2, 17–19]. Different types of flow behaviors like stationary bed, slowly moving bed, rolling bed, and dispersed moving beds are generally encountered based on the increased flow rate of liquid flow, as presented in Fig. 3.3. 3.1.4 Solid–Liquid–Gas Three-Phase Flow Systems Figure 3.4 shows the schematic and actual flow representation of multiphase flow (Solid–liquid–gas) systems in cutting transportation perspectives [2, 17]. Like the solid–liquid system, the three-phase system also possesses a similar flow pattern, and solid transport increases with a rise in liquid flow rates. The stationary solid bed breaks up in a different pattern of moving dunes. Some solid particles roll on the, while the other solid accumulates in the lower part of the dunes. This mechanism pushes the solids in the flow direction (Fig. 3.5). 3.2 Flow Assurance Issues in Drilling Applications (Cutting Transport) Solid particles (cuttings) are produced in petroleum drilling by the drill bit when it is forced downhole at a specific penetration rate (ROP). The cuttings are then conveyed to the surface by the often shear-thinning drilling fluid through the annular gap (formed by the drill pipe1 in a wellbore). 3 Multiphase Flow Systems and Potential of Machine Learning … 31 Fig. 3.2 Liquid–liquid flow regimes orientation in the horizontal annulus: a pictorial b Schematic 3.3 Introduction of Cutting Transport Issues Among the many roles of drilling fluid, hole cleaning, or the movement of cuttings from the bit to the surface, is a critical function that impacts the drilling process’s efficiency. Hole cleaning removes drill cuttings from a borehole and transports them to the surface. Across the last 30 years, cutting transportation has gotten much attention, and experts worldwide have researched it. It is mostly determined by the drilling mud’s viscosity and gel strength. If the drilling mud lacks viscosity, it will be unable to 32 M. S. Khan et al. Fig. 3.3 Solid–liquid flow regimes orientation in the horizontal annulus: a Schematic b pictorial pull the cuttings from the bottom of the borehole to the top. Again, if the drilling mud has sufficient gel strength, it will be unable to suspend the cuttings once the mud pump is turned off. However, the effect of viscosity in horizontal wells is different compared to vertical wells [2, 20]. It has been observed that cutting transport or hole cleaning is more difficult in horizontal and direction wells than in vertical wells. Cutting transport becomes significantly more difficult as wellbore angles exceed 30°. The cause of the hampered transportation is the formation of stagnant beds, which dramatically increase friction and, as a result, restrict the annular area of the cutting to move or carry. These drill cuttings can cause various issues, including drill pipe sticking, increased torque, drag, fluid circulation loss, loss of control over mud density. On top of that, it significantly increases the cost of drilling operations, resulting in the waste of hundreds of millions of dollars worldwide. An assessment conducted by 3 Multiphase Flow Systems and Potential of Machine Learning … 33 Fig. 3.4 Gas–solid-liquid flow regimes orientation in the horizontal annulus: a Schematic b pictorial Amoco experts that focused on 70% of its lost time due to unexpected events revealed that clogged pipe problems were the primary source of wasted time. Even though extensive research has been undertaken to identify how different parameters affect the cutting transport process in directional and horizontal wells. Adequate cuttings transport is essential for appropriate hole cleaning, i.e., the absence of a critical cuttings bed to avoid costly drilling downtimes due to clogged pipes. Many parameters influence the quality of solids transport [21, 22], two of which are drill pipe rotation and eccentricity. Several experimental research studies have been conducted because of the importance of cuttings transport in the drilling sector [23]. 34 M. S. Khan et al. Fig. 3.5 Classification of existing cutting transport models Understanding the mechanism of cutting transport in the annulus is critical. There is no accumulation of drill cuttings when the annular velocity (flow rate) is high enough. The critical transport velocity is the speed at which there is no accumulation of bed height, and all cuttings can efficiently transfer to the surface [24]. The bed height increases during sub-critical transport velocity as the annular flow area decrease, resulting in a steady increase in cuts’ local velocity. Mud continues to accumulate until the local velocity reaches a threshold number. Then, an equilibrium bed height is reached at that particular sub-critical flow transport velocity or flow rate. As a result, equilibrium bed height depends on critical velocity [24]. The constant buildup of cut depositions results in various bed formations, such as moving beds and stationary beds. When stationary bed formation occurs, two potential mechanisms can cause solid transport: saltation behavior. The lift force induced by the fluid overcomes the gravitational force and sliding phenomenon, in which viscous force is more dominant than friction between the solid cuttings and pipe wall. Figure 3.5 depicts a generic classification of several sorts of models. Since its inception, the development of various cutting transport models has been centered on three distinct directions: empirical models, mechanical models, and, more recently, numerical models. Empirical correlations are generated using various experimental data, whereas mechanical models consider the physical mechanics of cutting transit. On the other hand, numerical models rely on mesh generation and accurate analysis of individual mesh sizes. Empirical models are rarely utilized because they require many variables, some of which are difficult to simulate at the lab scale, limiting their application [25]. Again, mechanical models are classified as 1D (one dimension), 2D (two dimensions), and 3D (three dimensions). In 1D models, velocity is only considered in the Z direction (along with the wellbore axis). 3 Multiphase Flow Systems and Potential of Machine Learning … 35 Two-dimensional and three-dimensional models are rarely employed since solving a three-dimensional (unsteady-state equation); on fast workstations, the timedependent problem would take hours to solve and are practically useless in field applications [26]. In contrast, in 2D and 3D models, velocity is considered in the Z, X, and Y directions, respectively (velocity gradient both along and across the wellbore). These are further subdivided based on the number of annulus layers, i.e., two-layer and three-layer models. The next section offers a complete summary of the many models in historical sequence. 3.4 Evolution of Various Cutting Transport Models 3.4.1 Layer Model Wicks [26] created one of the first two-layer cutting transport models. Wicks’ idea was based on saltation and backed by experiments. His paper focused on lift force in the X direction (across the wellbore) instead of the Z direction (along the wellbore). Tomren and coworkers [27] discovered the following observations during their experimental investigation of cutting transfer: (1) When the vertical variation is less than 10°, cuttings transport is very comparable. (2) A cuttings bedforms at low flow rates. (3) The bed thickness grows with deviation until it is independent of the deviation angle. (4) Drill pipe eccentricity affects bed thickness but not fluid viscosity, depending on deviation and flow rate. To salt, a particle from the bed, drag, and lift must overcome gravity to rock it over its contact sites. As the particle falls through the fluid, its settling velocity reflects the balance of gravity and drag. The fluid velocity near the particle must be larger than the settling velocity to move a particle. So the liquid layer’s average fluid velocity must be several times the particle’s settling velocity. This model only applies to fine solids. Especially for coarse particles, high fluid velocities can cause bed sliding [28]. Gavignet and Sobéy [29] proposed a two-layer model with a stationary layer at the annulus’ bottom and a heterogeneous layer above. One of the first models that work for both fine and coarse particles. The diffusivity equation was used to calculate the solid composition of the heterogeneous layer [30]. Brown et al. [31] experimentally compared Gavignet’s model utilizing Dodge and Metzner’s Reynolds number for turbulent non-Newtonian flow [32]. This allowed them to calculate a cutting wall friction factor of 0.2 empirically. Instead of clear mud, Martins and Santana offered a two-layer model with a heterogeneous layer. It permitted particles to be suspended in the upper layer, unlike Gavignet and Sobey’s concept. Iyoho and Takahashi [33] observed spatial changes in cuttings bed height along the wellbore using a similar approach. All previous models assumed that the bed height remains constant along the wellbore. In this case, a two-layer model with triangular dunes was adopted. The model requires knowledge of pressure fluctuations: sliding and heterogeneous layer model by Clark [24] to forecast bed heights. The wellbore angle determines the primary mechanism. This is one of 36 M. S. Khan et al. the first devices to recognize that high angles require a rotating cutting bed. A lifting device transfers clippings at a churning, moving cuttings bed. Particle settling determines almost vertical transport. Based on various wellbore angles. Also, Kamp [34] used mass balance and momentum models to predict cutting transport behavior. In terms of closure terms, the model looks to be similar to Doron et al. Quantitatively, two-layered models outperform correlation-based models. At a given mud flow rate, the model overestimates cuttings transfer. 3.4.2 Layer Model Doron and Barnea [35] proposed a three-layer concept with a fixed bed, a moving bed, and a mixed layer in 1993. It was an extension of Doron’s two-layer model [30] proposed in 1987. The two-layer model’s fundamental flaw is its inability to reliably forecast the presence of a stationary bed at low flow rates. The three-layer model outperformed the two-layer model for low flow rates. According to Nguyen and Rahman [36], three layers of cuts with a uniform concentration and velocity. On top of that layer is a distributed cuttings layer with a Wilson-like velocity gradient [37]. The top layer is clear mud. Ramadan et al. [38] proposed a threelayer model for inclined channel flows. Experiments did not validate this model. Although the three-layer cutting transport model has been developed, it is still limited to Newtonian fluid flows in horizontal and nearly horizontal channels [37]. The prior modeling studies’ flaw of no-slip between particles and fluid was also eliminated. However, the no-slip assumption restricts the model to horizontal and near-horizontal situations [39]. 3.5 Empirical Model Research Centre Sunbury, comparing the effects of major parameters such as hole angle, penetration rate, mud characteristics, and flow regime. On the other hand, Zamora and Hanson [40] proposed an empirical model based on experimental and field observations to improve hole cleaning efficiency for high angle wellbore. Luo and Bern [41] proposed a model for determining the minimum flow rate required to clear or prevent stationary cuttings beds on the low-side of a deviated wellbore. The model was validated using experimental data from an 8” wellbore simulator at BP. Larsen et al. [40] created a model for strongly inclined wellbores (50–90°). The model forecasts the critical velocity and cuttings-bed thickness when the flow rate is below the critical flow. Based on empirical correlations from a 35 ft long 5-inch diameter flow loop. Valid for holes 500° or more or where cutting beds may occur. Hopkins [41] discovered that increasing drilling fluid density reduced bit cutting slip velocity and quantified this effect using a novel equation with modifications. The density of drilling fluid can only be increased so far. If the Equivalent mud density 3 Multiphase Flow Systems and Potential of Machine Learning … 37 exceeds the formation pressure, the formation may fracture. To estimate the critical or minimal velocity to lift the cutting from the wellbore, Rudi [42] established a new model with equations. This model develops Moore’s slip velocity of a vertical well for usage in inclined and horizontal wells with Larsen’s slip velocity method modifications for rotating speed and mud weight. The minimal mud rate of Larsen’s approach, Larsen’s experiment data, and Peden’s experiment data do not differ much from this new equation in the publication. However, at an inclination angle of 45°, the new equation produces a larger mud minimum rate than the previous techniques. Tobenna [43] used Bern-approach Lou’s and a correction factor in computing the critical flow rate for deviated wells. In 2017, Mohamad Ishaq et al. [44] examined the Rudi-Shindu [42], Hopkins [41], and Tobenna [43] models. Hopkins’ model [41] is modified by cutting size and RPM (RPM). The Tobenna [43] model’s minimum flow rate is only affected by well inclination, drilling fluid weight, and rheological characteristics. Rudi’s model is restricted to inclinations exceeding 45°. The explored models are not suited for horizontal wells because they do not contain lateral section effects [44]. Several writers have developed other empirical models optimized using experimental data sets [22, 45–48]. They were designed for a limited range of drilling settings and are dependent on the experimental setup. Extending the range affects its accuracy [48]. Recently, Khaled and colleagues [17] created a generalized dimensionless model for accurate prediction of cuttings concentration in deviated wells using data from many sources, including experimental work, computational fluid dynamics (CFD) simulation, and experimental data acquired from the literature. The model can predict the cutting transport behavior with a resounding accuracy of 90% for various hydrodynamic conditions. 3.6 Transient Model During the drill operations, the cuttings bed distribution changes in real-time. The conventional models can only calculate the unchanging height of the cuttings bed at the end of the formation, but not the changing cuttings bed distribution during the process. The annulus pressure drop is uncertain if the cuttings bed distribution is unknown. Similarly, removing the cuttings bed from the borehole takes time. The steady models can’t characterize the process and calculate the hydraulics. Iyoho et al. [49] introduced transient models for cutting removal in 1987. Subsequently, Martins et al. [52] developed a two-layer transient model for horizontal wells based on mass and momentum conservation equations. Shigemi Naganawa [50] devised a modified two-layer model to simulate cuttings transport along an extended-reach well’s complete trajectory in wellbore drilling. Other factors as cuttings concentration and bed height were also predicted in nonstationary flow [39]. Most of them are made up of nonlinear equations that are difficult to solve. So, real-time calculation in fields is difficult [51]. 38 M. S. Khan et al. We can conclude from the evolution of the different types of cutting transport models presented in chronological order and classified form in terms of their underlying mechanisms. It was observed that although the 2D and 3D models provide a better representation of actual cutting transport, 1D models are more comfortable to develop, solve, and take less time. However, there is still a need for improvement in the existing models. The Empirical models are not used for field application as many variables involved impose restrictions. Therefore, applying the latest predictive technique like machine learning is very important in this perspective. 3.7 Machine Learning Approaches for Cutting Transport Accurate cutting transport or hole cleaning is imperative for a successful drilling operation. It has been seen that although it is easier in the case of vertical wells, however, it is more difficult in the case of horizontal and extended reach well due to the accumulation of cuttings at the lower side of the borehole due to gravity. Over the years, several different techniques such as empirical, Dimensional analysis, mechanical and numerical models have been used for predicting cutting transport phenomenon. However, Artificial Intelligence (AI), especially the machine learning (ML) technique, is still very limited in this field [52]. Artificial neural networks (ANNs) are mathematical models inspired by studies on brain systems, consisting of highly interconnected processing nodes or elements (artificial neurons) under a pre-specified topology (sequence of layers or slabs with full or random connections between the layers). Ozbayoglu and coauthors [55] were one of the first who used Back Propagation Neural Network (BPNN) in Artificial Neural Network (ANN) for Horizontal and Inclined wells. They developed three nondimensional parameters, i.e., Reynold number, Froude number, and cutting concentration at the bit, to predict the cuttings bed height of the stationary bed. Experimental data was used for developing the model using the traditional least-square fit and BPNN method. They revealed that ANN showed higher accuracy than the least square fit method. Rooki and coauthors [53] compared the BPNN and Multi Linear Regression (MLR) methods for predicting the cutting concentration during foam drilling for a Horizontal Well. Like Ozbayoglu [54], they revealed that BPNN showed a lower Average Absolute Percentage (AAPE) than the MLR Method, highlighting ANN technology’s effectiveness. Later on, Rookie and Rakhshkhorshid [55] used the Radial Basis Function Network (RBFN) method to predict the cutting concentration in a horizontal well. They [55] recommended that RBFN is a better prediction tool than the BPNN method, which showed higher accuracy, faster training, and simpler network architecture. Al-Azane and coauthors [56] used the Support Vector Machine (SVM) network for predicting the cutting concentration for horizontal wells. Aliouane and Ouadfeul [57] proposed a machine-learning algorithm to generate a poisson’s ratio map, which can be used to predict drilling direction and rock properties. Castineria et al. [58] used machine learning to assess the quality of large amounts 3 Multiphase Flow Systems and Potential of Machine Learning … 39 of drilling data, obtain critical information, and forecast non-productive time. This method helped reduce labor costs when checking the quality of large amounts of drilling data. Deepwater drilling can use the Bayesian network (BN) for Managed Pressure Drilling (MPD) and Under Balanced Drilling (UBD) operations. According to Bhandari et al. (2015), the BN can be used effectively for offshore industry risk analysis and failure prediction. Automation was used to control drilling parameters such as Weight of Bit (WOB), Rotary Speed (RPM), and Rate of Penetration (ROP). A machine learning algorithm can collect information on potential bit or rig equipment upgrades and estimate abrasive and anticipated bit wear [59]. Two-phase flow is the interaction of two distinct phases in a channel that share common interfaces, with each phase representing a mass or volume of matter. Both phases are capable of coexisting as solids, gases, or liquids. Although three-phase multiphase flow occurs, the bulk of multiphase engineering applications uses a twophase flow. Planning, development, and optimization are required for flow in any channel. Based on the interfaces generated between the phases, predicting the flow phases and flow regimes is critical, i.e., typical flow patterns. Based on the flow rate, channel size, and operating conditions, this knowledge allows for predicting pressure drop and heat transfer characteristics. The appropriate flow parameters can be determined based on the pressure drop data to reduce the occurrence of corrosion, erosion, or scale development, all of which can lead to excessive friction. Predicting flow regimes, such as oil and gas flow in pipelines or chemical process industries, allows avoiding excessive gas pressure buildup, meltdowns, and potentially hazardous explosions. The results of heat transfer analysis can be utilized to design flow channels and operating conditions and forecast and avoid flow instabilities. The heat transfer community and practicing engineers are predominantly interested in two-phase flow, which involves phase transition between a single substance’s liquid and vapor phases. Two-phase flow refers to the fluid flow of a two-phase mixture, which can be (1) liquid–vapor flow, (2) liquid–liquid, (3) liquid–solid particles, or (4) gas–solid particles. This category includes forced convective condensation and boiling. Solving two-phase flow and heat transfer problems is extremely difficult because each phase has its own properties, velocity, and temperature. The conveyance of multiphase well fluids is extremely prevalent in the oil industry. When the fluid from an oil and gas well reaches the wellhead, it forms a three-phase (oil, water, and gas) or two-phase (oil and gas) mixture. A single-phase liquid or gas flow at the wellhead is an extreme example. The multiphase fluid flow analysis is used to mimic the behavior and interactions of two fluid phases. The study uses the Volume of Fluid (VoF) method, a typical multiphase system computing method. Because of the variety in flow regimes, multiphase flow is substantially more difficult than single-phase flow (or flow patterns). Fluid distribution varies dramatically throughout flow regimes, influencing pressure gradients inside and outside the drill string. 40 M. S. Khan et al. 3.8 Flow Assurance issues in Liquid Loading Applications 3.8.1 Introduction of Liquid Loading Issue Most natural gas wells have enough reservoir pressure when they are first completed to flow formation fluids (liquid hydrocarbons and water) to the surface and the produced gas. As production continues, reservoir pressure falls, and the flowing fluid’s velocity in the well tubing begins to fall. Eventually, the gas velocity up to the production tubing is insufficient to lift liquid droplets to the surface. This phenomenon occurs when the upward gas velocity in the well falls below a critical value, known as critical velocity [66, 67]. The critical velocity is when the produced liquids, primarily flowing upwards, begin to drop back, causing liquid loading problems. This downhole liquid accumulation affects hydrostatic back-pressure on the reservoir, lowering production rates, disrupting the multiphase flow in the gas well (due to flow regime changes), and, in extreme cases, destroying natural gas wells presented in Fig. 3.6. Aside from dry natural gas wells, liquid loading concerns in the wellbore for volatile gases like condensates gas wells might be seen. When the pressure falls below the dew point pressure, gas condensates in the form of liquid form, imposing liquid loading. The typical liquid loading behavior in vertical and horizontal gas wells is depicted in Fig. 3.7. 3.8.2 Flow Pattern Analysis for Liquid Loading System Different flow patterns can occur when two phases (gas–liquid) pass through a wellbore/pipeline. Common flow distributions are bubbly, stratified, slug, annular, and Fig. 3.6 Evolution of the liquid loading in a natural gas well 3 Multiphase Flow Systems and Potential of Machine Learning … 41 Fig. 3.7 The characteristic liquid loading behavior in vertical and horizontal gas wells [11] separated flows. Small bubbles are dispersed with a liquid phase in bubbly flow, whereas more oversized liquid slugs or larger gas pockets can form in slug flow. In stratified flow, the liquid and gas phases are separated, and the gas flows on top because it is lighter than liquid; and annular flow, where liquid flows as a film on the inner surface of the tubing. Mandhane et al. [68] offered a typical flow pattern map in the literature. The flow map attempts to anticipate the many sorts of flow zones. The flow map developed by Mandhane et al. [68] has been the most commonly used flow map for gas/Newtonian flow. They generated this flow map for horizontal two-phase flow using around 1400 experimental data from the AGA-API two-phase flow data bank. The most important flow pattern transitions in the prediction of liquid loading are linked with patterns of slug-to-churn and churn-to-annular flow. Even with the advent of modern instrumentation, it is now possible to obtain high-frequency measurements of critical flow parameters (e.g., phase fraction, pressure, temperature, velocity). The observed regime’s interpretation remains highly subjective [69]. The minimum gas flow rate model developed by Nosseir et al. [69] was based on the impact of flow regimes and variations in flow circumstances in natural gas wells. Moreover, Guo et al. [70] developed a closed-form analytical solution for determining the minimum gas flow rate for continuous liquid removal from a gas well. The following are the typical symptoms of liquid loading: • Unanticipated production losses • The production of slugs or plugs in the fluid stream. • Unanticipated variance in pressure gradients. • Low-temperature spikes in the temperature profiles at the wellhead. It is difficult to determine the beginning liquid loading point because it is not always obvious [71, 72]. A comprehensive well diagnostic data analysis must be performed to discover the origin of the liquid loading problem [73]. The most subjective liquid loading symptom is identified using flow mapping [74, 75]. Another critical criterion is to monitor changes in the gas wells’ pressure gradient or pressure 42 M. S. Khan et al. profile. Understanding the components that influence liquid loading is critical for overcoming it. The superficial gas velocities (Vg,s) and superficial liquid velocities (Vl,s) have the greatest influence on creating different flow regimes in a natural gas well. Figures 3.8 and 3.9 represent the liquid holdup with a typical flow pattern in a horizontal and vertical gas well. Fig. 3.8 A schematic representation of liquid holdup in horizontal gas wells with a typical flow pattern [76] Fig. 3.9 A schematic representation of liquid holdup in vertical gas wells with a typical flow pattern [77] 3 Multiphase Flow Systems and Potential of Machine Learning … 43 3.8.3 Prediction Models for Liquid Loading Although several established techniques are used to alleviate the effects of liquid loading, the industry still lacks reliable predictive models to help select the best remedial option for a particular loading occurrence. Gas wells must operate at or above a predetermined minimum rate to avoid liquid loading. “The critical gas rate” is defined as the minimum stable gas rate (MSGR) required to produce condensate liquid or water to the surface without the accumulation of liquids below the surface. There are various correlations for estimating the critical gas rate, the majority of which are based on Turner’s [78] pioneering work conducted in 1969, with improvements presented by Coleman et al. [79], Li et al. [80], and many others. Most generalized critical gas velocity correlations include the following correlating parameters: bottom-hole flowing pressure “Pwf ,” psi, tubing radius “rw,” in inches, gas density “g,” lb/ft3 , liquid density “L,” lb/ft3 , surface tension “g–L,” dyne/cm, bottom-hole temperature “T,” °R. The fundamental force balance acting on liquid droplets’ balance includes the drag force of gas flowing upward and the downward force of the droplet’s weight. The drag force should be consistently higher than the gravity force. Fd = Fg (3.1) Fd = π d2 1 ρG C D VC2 2gc 4 (3.2) Fg = g π d3 (ρ L − ρG ) gc 6 (3.3) with after substitution / VC = 4g (ρ L − ρG ) d 3 ρG CD (3.4) The variables in the expression to evaluate the critical velocity include the drag coefficient (Cd), which depends on the Reynolds number, the diameter of the droplet, gas, and liquid densities in hydrocarbon condensate systems change significantly offshore flowlines due to immense pressure and temperature gradients. Though significant efforts have been made to predict the flowing conditions at which the well remains out of the liquid loading region using the so-called “Turner’s criteria,” these do not capture the dynamics of the loading sequence. Operators frequently use Turner’s criteria to design a production system to remove all liquids from the well at gas rates high enough to do so. It’s impossible to tell how much of a problem the loading is or how quickly it will slow down production with the 44 M. S. Khan et al. help of these tools. From a flow mechanics perspective, It is critical to comprehend flow patterns and flow pattern transitions. The shape and behavior of the interface between phases in a multiphase mixture determine the “flow regime” or “flow pattern.“ Within the multiphase fluid, competing forces or mechanisms are at work simultaneously, and the balance determines the flow pattern. Additionally, the proportions and properties of the phases coexisting in the well/tubing must be determined to model multiphase flows associated with liquid loading in gas wells. A turbulent gas core with numerous entrained liquid droplets exists in an annular flow at the well’s center, while a brittle liquid layer (m to mm) exists at the tubing’s surface. At the bottom of the well, a turbulent gas core generates frictional pressure drop, while a thin liquid coating imposes hydrostatic pressure load. As a result, boosting gas production to minimize liquid loading may not solve a natural gas well’s liquid loading. Modeling methodologies used to characterize liquid loading in gas wells include empirical, phenomenological, two-fluid, and drift-flux models. Particular emphasis is placed on these approaches’ ability to capture the ephemeral aspect of the loading process. Phenomenological models are flow-pattern-based models that rely on identifying a specific flow regime and the use of adhoc pressure drop computations. Examples of phenomenological models include those based on the unit cell concept for slug flow in vertical pipes, which take into account the actual flow configuration (long Taylor bubbles separated by aerated liquid slugs) in the formulation of ad hoc models for calculating the void fraction, wall shear stress [81–84]. Data for frictional pressure gradient and void fraction are connected to system variables using empirical equations in empirical models. Many trials are required to duplicate a specific situation to develop a reliable empirical model, but this can be costly. The model is only applicable to a limited set of conditions unless the dimensional analysis is performed. There are several advantages to relying on empirical models rather than fundamental physical mechanisms. The two-fluid model does not work well with intermittent flow patterns like slug flow. Liquid flows upward in the Taylor bubble zone but downwards in vertical upward slug flow, making averaging liquid properties difficult. The relative motion between phases in most separated flows is closely proportional to the pressure and velocity gradients in the two phases. A drift flux model cannot account for this. The two-fluid technique also does not adequately capture churn flow. This flow pattern can be considered an annular flow with periodic reversals in the liquid film. Waves have developed, carrying the liquids upwards. A film travels downhill between the waves, replenishing the next upstream wave from which liquid is draining. The result is net upward liquid transfer. The two-fluid model does not account for this flow intermittency. Waltrich et al. [85] collected steady-state and transient two-phase flow experimental data at Texas A&M University’s TowerLAB facility in the United States, using a transparent vertical test Sect. 42 m in length and 0.048 m ID. As working fluids, air and water were used. Comparisons were made between a benchmark algorithm for multiphase flow in pipes, experimental data, and HyTAF, showing the need for additional research in this area. Alves et al. [86] demonstrated a satisfactory agreement between the observed pressure gradients of Waltrich et al. [85] and those predicted by HyTAF for 3 Multiphase Flow Systems and Potential of Machine Learning … 45 an induced transient example, from steady-state annular flow to steady-state churn flow. Most models used to forecast and diagnose liquid loading issues are based on steady-state analysis. As a result, they cannot deal with the transient phenomena associated with liquid loadings, such as the gradual buildup of the static fluid column in the well and the resulting increase in back-pressure on the formation. In business and academia, efforts are being made to link observed well dynamics with the intermittent reservoir response typical of liquid loading in gas wells. Even when transient multiphase wellbore models are used, the problem remains incorrectly described because the reservoir is characterized using a steady-state Inflow Performance Relationship (IPR), resulting in inaccurate boundary conditions between the well and the reservoir. Yang et al. [87] provided a new set of methods for determining the critical velocity for inclined wells that consider the various forces acting on a liquid droplet. They thought that the droplet constantly rises through the tubing’s midsection and is unaffected by the wall. Ming et al. [88] created a model that considers the degree of deviation and the influence of the Reynolds number. Their [88] findings suggested that the Reynolds number had a favorable impact on the critical liquid carrying velocity; however, the degree of variations had a negative impact. The standard pressure profile in the near-wellbore region of a flowing reservoir cannot characterize the transitory phenomena that occur during liquid loading. Because of a combination of inertia and compressibility effects, the reservoir reaction to wellbore phase redistribution effects is not instantaneous. A more reliable technique would be to utilize a transient multiphase flow wellbore model using the transient properties of the reservoir’s near-wellbore region as boundary conditions. Despite the several two-phase flow modeling methodologies available, it is critical to capture the transition from annular flow to churn flow, then to slug flow, and finally to bubble flow, which may result in the well’s demise. More study is needed in this area to develop credible predictive models that can assist in selecting the optimal remedial solution for a given incident of liquid loading. Table 3.1 summarizes the gas/liquid flow investigations on various types of fluxes. As previously stated, liquid loading is a common concern in gas wells, necessitating the development of a modified analytical model for predicting its occurrence and critical gas velocity. Monitoring the pipe’s appearance and position of deviated wells will necessitate greater experimental efforts. As highlighted from the brief literature review, liquid loading in the gas wells is one of the most problematic scenarios encountered during the production stages of the reservoir [13, 69, 71, 73, 89, 90]. The smooth gas production from the gas wells hinders the liquid loading issues. The undesired condensate and water are entrained in the gas phase below the dew point as the liquid phase goes below the bubble point pressure. The problem could even be worsened when solid particles are encountered in the gas wells. Therefore, it is highly desired to adopt the sophisticated and latest computational approach such as machine learning to accurately predict the onset of liquid loading (Tables 3.2 and 3.3). 46 M. S. Khan et al. Table 3.1 Literature for ML technique applied in hole cleaning Author and Year Well Type ML Technique Parameter Studied Error Ozbayoglu et al. [54], 2002 Horizontal and highly inclined wells BPNN Cuttings bed height Error < 10% BPNN and MLR Cutting concentration during foam drilling AAPE for ANN < 6%, AAPE for MLR < 9% Rooki et al. [53], Horizontal annulus 2014 Rooki and Rakhshkhorshid [55], 2017 Horizontal annulus RBFN Cutting concentration in underbalanced drilling AAPE = 5.7% Al-Azane et al. [56], 2018 Horizontal and Deviated wells SVM Cutting concentration AAE < 5% Al-Azani et al. [60], 2019 Horizontal and Deviated wells ANN and SVM Cutting concentration AAE < 5% Sorgun et al. [61], 2015 Horizontal Annulus Support Vector Regression Pressure loss AAE < 6% Osman [62], (2004) Deviated well BPNN Flow regime Identification and calculate Liquid hold up AAE < 10% Sorgun and ulcer Horizontal pipe TrainGdx–Tansig [63], 2016 Pressure drop AAE < 20% Ozbayoglu et al. [64], 2009 Horizontal wellbore Several ANN techniques Fluid pattern and pressure drop AAE for fluid patter < 5%, AAE for pressure drop < 20% Ashena and Moghadasi [65], 2011 Vertical wellbore BPNN, Ant Colony Optimization (ACO), Genetic Algorithm (GA.) Bottom hole pressure estimation ACO and GA performs better as compared to BPNN 3.8.4 Machine Learning Approaches for Liquid Loading or Gas/liquid Flow Determining multiphase flow parameters like flow pattern, pressure drop, and the liquid holdup is a difficult and valuable problem in the chemical, oil, and gas industries, especially during transportation. There are two basic approaches to solving this problem in the literature: data-driven algorithms and mechanistic models. Although data-driven methods are more accurate in forecasting, they do not reveal the twophase characteristics (i.e., pressure gradient, gas and local liquid velocities, liquid holdup, etc.). Machine Learning is the latest prediction technology for efficiently 3 Multiphase Flow Systems and Potential of Machine Learning … 47 Table 3.2 Gas/liquid two-phase flow studies Authors and Year Type of Fluid Geometry Dimension Studied Parameters Ansari et al. [91], 1994 Gas wells Vertical and directional wells 4.57– 17.78 cm ID length, Wellhead pressure Developed mechanistic model Vertical 7.62 cm ID/18 m Minimum flow length rate Coleman et al. Gas wells [79], 1991 D. Barnea [92],1987 Air and water Vertical-Inclined 5 cm ID, 3.45 bar– 43.13 bar Hakim et al. [93], 2018 Air and water Vertical 7.62 cm ID/40 m Pressure gradient length and liquid holdup Goal and Valkó [94], 2016 Air and water Vertical 4.8 cm ID/42 m length Ikpeka and Okolo [95], 2019 Air and water Vertical and deviated 3.1 cm ID/9.5 m A new model to length, Wellhead predict liquid pressure = loading 40 bar Guo et al. [96], 2005 Gas wells with oil and water Vertical wells Different tubing sizes, Wellhead pressure Develop a new correlation Pedro Air and water Cavalcanti De Sousa [97], 2013 Vertical 6.03 cm ID/13.97 cm OD/42 m length Investigate unexpected periodic release of liquid slugs Paulo Jose Waltrich [85], 2011 Air and water Vertical 50 cm ID/42 m length Visualize two-phase flow regimes and measure pressure and liquid holdup Riza et al. [98], 2016 Air and water Vertical 50 cm/42 m length Study of liquid loading phenomena Slightly inclined (0.65° and 2.1°) 5 cm ID/26 m length Flow regime Andreussi and Air and water Person [99], 1987 Alsaadi et al. [100], 2015 Air and water Operative equation and dimensionless map Flow regime and validate a liquid content model Vertical-Directional 7.62 cm ID/18 m Pressure gradient (60° to 88°) length and liquid holdup (continued) 48 M. S. Khan et al. Table 3.2 (continued) Authors and Year Type of Fluid Geometry Dimension Studied Parameters Guner et al. [101], 2015 Air and water Vertical-Inclined (90° to 45°) 7.62 cm ID/18 m Pressure gradient, length liquid holdup, and visualization Skopich et al. [102], 2015 Air and water Vertical 5.08 cm and 10.16 cm ID/167.1 m length Pressure gradient and liquid holdup Dinaryanto et al. [103], 2017 Air and water horizontal pipe 2.6 cm ID/10 m length at 8 bar pressure Flow regime map and visualization Kong and Kim Air and water [75], 2017 horizontal pipe 3.1 cm ID/9.5 m Flow regime length transition and Frictional pressure drop analysis Kesana et al. [104], 2017 Air and water/air horizontal and Aqueous Carboxymethyl Cellulose (CMC) solution 7.62 cm ID/18 m Flow pattern map length and effect of liquid viscosity on slug flow distributions Kong et al. [76], 2017 Air and water 3.81 cm ID/9.5 m length horizontal Flow regime mapping, the void fraction, bubble velocity analysis was also performed predicting gas–liquid systems. For instance, Shaban et al. [105] employed an elastic mapping technique to produce a flow pattern map from differential pressure signals. Different flow patterns for air–water two-phase flow in a vertical pipe were examined. The elastic mapping method is a machine learning technology that reduces the number of data dimensions displayed in a two-dimensional map. The produced map displayed well-defined and clustered data of the same types of flow patterns. Al-Naser et al. [106] detected the flow pattern in a horizontal pipe using MATLAB and its built-in neural network technique. The authors generated input for various flow patterns using the unified model simulator. They [106] created a universal 3-D flow pattern map for various dimensions and fluid parameters based on the liquid Reynolds number, gas Reynolds number, and pressure drop multiplier. They showed that the model, based on the natural logarithm of the three dimensions, can correctly predict up to 97 percent of the flow patterns. Deep machine learning was applied by Ezzatabadipour et al. [107] for pipes with diameters of 1 or 2 inches and varying pipe inclinations; to predict annular, bubble, scattered bubble, intermittent, stratified smooth, and stratified wavy flows. They used a feedforward neural network known as a multilayer perceptron (MLP) to train 60 3 Multiphase Flow Systems and Potential of Machine Learning … 49 Table 3.3 Machine learning approaches applied on gas/liquid systems Authors and year Application Machine learning technique Al-Naser et al. [106], 2016 Flow pattern detection in horizontal conduit ANN technique Ezzatabadipour et al. [107], 2017 Flow regimes predictions for 2-inch pipelines Deep learning approach Amaya-Gómez et al. [108], 2019 Predictions of flow regimes maps Bayesian supervised method Alhashem [113], 2019 Forecasted multiphase flow regimes in horizontal pipelines Decision Tree, Random Forest, Logistic Regression, Support Vector Machine (SVM), and Neural Network Multi-Layer Perceptron were the methods evaluated in the study Hernandez et al. [109], 2019 Classification of various flow Data-driven methodology for regimes for horizontal pipelines decision tree-based model Almalkai and Ahmed [110], 2020 Flow pattern analysis from downstream of the orifice Classification Learner approach in MATLAB Mask et al. [111], 2019 Flow pattern analysis via dimensionless numbers XGB tree model (machine learning) approach Sami and Ibrahim [112], 2021 Flowing bottom-hole pressure Random forest, K-Nearest (FBHP) prediction for gas wells Neighbors (K.N.N.), and artificial neural network (ANN) percent of a total of 5676 data points, with 20 percent for validation and 20 percent for testing. The outcomes showed that the strategy could predict the flow pattern accurately. Amaya-Gómez et al. [108] suggested a Bayesian supervised method with a novel visualization tool for flow pattern maps. Hernandez and coworkers [109] introduced a machine learning-based data-driven approach for flow pattern classification. A decision tree-based model was developed and then validated for flow pattern prediction using a set of 9224 observations using the data-driven methodology. Over a wide range of two-phase flow conditions, the closure relationship selection model correctly classified flow regimes. The intermittent flow was found to be the most accurate (86.32 percent), while the annular flow was found to be the least accurate (49.11 percent). The results show that less than 10% of global accuracy is lost compared to direct data-based algorithms, which is explained by the poor performance for unusual values and zones close to flowing pattern borders. The local pressure drop has been the focus of much research on two-phase flow via orifices. Despite the topic’s relevance, flow patterns downstream of an orifice have gotten comparatively little research. As the mixture passes through the aperture, the momentum of the phases increases considerably. Almalkai and Ahmed [110] introduced the ML technique for the flow pattern behavior analysis downstream 50 M. S. Khan et al. of an orifice in a horizontal pipe. Findings revealed that the Classification Learner environment, a Machine Learning Algorithm in MATLAB, provides a total error of 9%, which indicates its prediction ability for flow pattern downstream of the orifice. Fluid characteristics, liquid and gas flow rates, flow conduit shape, and mechanical factors influence the flow pattern. Mask et al. [111] used hydraulic basics and dimensional analysis to reduce the number of freedom dimensions to produce three upscaling numbers. They used machine learning techniques on dimensionless variables to dramatically enhance their predicted accuracy to 90% or more than the usual dimensional model using experimental data, which gave an accuracy of 80%. Oil and gas production wells are evaluated based on the flow of bottom-hole pressure (FBHP). Oil production optimization, oil lifting costs, and workover operation assessment necessitate accurate FBHP predictions in the petroleum sector. Sami and Ibrahim [112] used three machine learning techniques to forecast the multiphase FBHP: random forest, K-Nearest Neighbors (K.N.N.), and artificial neural network (ANN). The results showed that using an artificial neural network model resulted in a 2.5 percent error in estimating the FBHP, which was less than the 3.6 percent and 4 percent errors in the random forest and K-nearest neighbor models. Alhashem [113] forecasted multiphase flow regimes in horizontal air, water, and oil pipelines using supervised machine learning (ML) approaches. The input features used were water cut (the proportion of water), gas superficial velocity, and liquid superficial velocity. The output was projected to be one of six different flow regimes. The methods evaluated in the study were Decision Tree, Random Forest, Logistic Regression, Support Vector Machine (SVM), and Neural Network Multi-Layer Perceptron (MLP). Their findings revealed that the random forest algorithm, with high accuracy of up to 90.8 percent and a short training time (0.13 s), is the best candidate for the dataset to increase the size of the data and features. 3.9 Case Studies in Multiphase Flow Assurance Petroleum companies are actively looking for new ways to become more efficient, such as streamlining production, lowering costs, and improving worker safety, among other things. Several administrators look to digitize to protect their businesses with lower oil prices and a recovering economy. The ML or AI are implemented in various fields within the industry, including production optimization, detecting oil seep, precision drilling, boosting production with predictive maintenance. The following paragraph only focuses on the case study in the cutting transport area. Shell Industry is a leader in exciting AI applications. Shell uses reinforcement learning to control its drilling equipment, essentially rewarding the AI’s choices [52]. A machine learning model, for example, is trained on historical drilling data and simulations to guide the drill into the subsurface. It also takes seismic data, temperature, pressure, and drill bit data into account. The steerer can then use reward and punishment functions to assist the drilling machine in adapting to changing subsurface conditions. This allows the geosteerer to understand the environment 3 Multiphase Flow Systems and Potential of Machine Learning … 51 better, resulting in faster results and less machine damage. In any case, progress is being made. Shell is always looking for big ideas to push the boundaries of the oil and gas industry. Shell game-changer regularly solicits machine learning-focused AI proposals from individuals and start-ups worldwide. Shell is leading to help solve some of the industry’s biggest challenges by investing in these ideas and collaborating on projects. Throughout the process, AI is being implemented or tested. The company recently implemented semi-supervised reinforcement learning to manage its drill rigs. However, machine learning can work with unlabeled data (supervised or unsupervised learning). Reinforcement learning strikes a middle ground by rewarding the AI’s “choices” based on their success. Shell’s drilling history and simulated explorations create algorithms that guide drills through the subsurface. It includes drill bit mechanical data like pressures and temperatures and subsurface seismic data. As a result, a Shell geosteerer is the human programmer of the drilling machinery, resulting in faster results and less wear and tear on machinery. 3.9.1 Conclusion Since This chapter provided a high-level overview of the multiphase system, including cutting transport and liquid loading in the flow assurance domain. The first sections discussed the process and existing prediction methods and their limitations. The research also includes a literature review on machine learning applications in the cutting transport and liquid loading fields. According to the machine learning literature, the application of ML is still in its early stages, especially for multiphase systems. Furthermore, the accuracy of predictive algorithms can be improved by gaining experience, either by increasing the size of the dataset or by adding relevant features. The oil and gas sector is entering a different normal of pandemic situation. Industry players must adapt to the new reality and improve their supply chain and activities. In this perspective, the appropriately trained ML model and logic can be tailored to the industry to provide automated flow control or install prediction and mitigation solutions for pipelines and field operations, potentially changing the oil industry’s value chain. References 1. Qasim A, Saad Khan M, Lal B, Mohd. Shariff A, Che Ismail M, (2021) Evaluation of tetramethylammonium acetate as corrosion suppressor for flow assurance applications. Mater Today Proc. https://doi.org/10.1016/j.matpr.2021.03.568 2. Khan MS, Barooh A, Rahman MA, Hassan I, Hasan R (2021) Investigation of Flowzan as nonnewtonian cutting transport fluid in directional drilling applications via electrical resistance tomography method. In: ASME 2021 40th international conference on ocean, offshore and arctic engineering 52 M. S. Khan et al. 3. Bavoh CB, Lal B, Nashed O, Khan MS, Keong LK, Bustam MA (2016) COSMO-RS: an ionic liquid prescreening tool for gas hydrate mitigation. Chinese J Chem Eng 11:1619–1624 4. Ahmed I, Saad M, Lal B, Abdullah H, Alsaiari A (2021) Dual-functional gas hydrate inhibition of tetramethylammonium chloride for carbon dioxide-methane mixed gas systems. Fuel 305:121598 5. Khan MS, Bavoh CB, Partoon B, Lal B, Bustam MA, Shariff AM (2017) Thermodynamic effect of ammonium based ionic liquids on CO2 hydrates phase boundary. J Mol Liq 238:533– 539 6. Bavoh CB, Lal B, Ben-Awuah J, Khan MS, Ofori-Sarpong G (2019) Kinetics of mixed amino acid and ionic liquid on CO2 hydrate formation. IOP Conf Ser Mater Sci Eng 495:012073 7. Khan MS, Lal B, Sabil KM, Ahmed I (2019) Desalination of seawater through gas hydrate process: an overview. J Adv Res Fluid Mech Therm Sci 55(55):65–73 8. Qasim A, Heurtas J, Khan MS, Lal B, Mohammad Shariff A, Cezac P, Siak Foo K, Sundramoorthy JD (2021) Thermodynamic modeling of electrolytic solutions of ionic liquids for gas hydrates inhibition applications. J Adv Res Fluid Mech Therm Sci 81:110–123 9. Khan MS, Lal B, Shariff AM, Mukhtar H (2019) Ammonium hydroxide ILs as dual-functional gas hydrate inhibitors for binary mixed gas (carbon dioxide and methane) hydrates. J Mol Liq 274:33–44 10. Bolujo EO, Fadairo AS, Ako CT, Orodu DO, Omodara OJ, Emetere ME (2017) A new model for predicting liquid loading in multiphase gas wells. Int J Appl Eng Res 12:4578–4586 11. Liu T, Zhou X, Chen H, Lu G, Zhao Z, Liu D, Du Y (2019) Popularization and application of the capillary foam deliquification technology in horizontal wells with low pressures and low liquid flow rates: a case study on middle–shallow gas reservoirs in the Western Sichuan depression. Nat Gas Ind B 6:25–33 12. Gonzalez-Miquel M, Massel M, DeSilva A, Palomar J, Rodriguez F, Brennecke JF (2014) Excess enthalpy of monoethanolamine + ionic liquid mixtures: how good are COSMO-RS predictions? J Phys Chem B 118:11512–11522 13. Alsadoun R, Al Momen M, Luo H (2020). Prediction of liquid loading in gas condensate and volatile oil wells for unconventional reservoirs. https://doi.org/10.2523/iptc-19993-abstract 14. Anisa IN, a., Nour H a. (2010) Effect of viscosity and droplet diameter on water-in-oil emulsions: an experimental study. Eng Technol 38:213–216 15. Khan MS, AHmed I, Mutalib I, Bostum A, (2015) Role of oxygenated aditives for diesel fuel blend - a short review. J Appl Sci 15:619–625 16. Yusof ZAM, Ahmed I, Khan MS, Hussain SA, Hussain A, Mutalib I, bin A, Balkhair KS, Albeirutty MH, (2015) Thermal evaluation of diesel/hydrogen peroxide fuel blend. Chem Eng Technol 38:2170–2180 17. Khaled MS, Khan MS, Ferroudji H, Barooah A, Rahman MA, Hassan I, Hasan AR (2021) Dimensionless data-driven model for optimizing hole cleaning efficiency in daily drilling operations. J Nat Gas Sci Eng 104315 18. Khan MS, Barooah A, Rahman MA, Hassan I, Hasan R, Maheshwari P (2021) Application of the electric resistance tomographic technique to investigate its efficacy in cuttings transport in horizontal drilling scenarios. J Nat Gas Sci Eng 104119 19. Morshed M, Khan MS, Rahman MA, Imtiaz S (2020) Flow regime, slug frequency and wavelet analysis of air/Newtonian and air/non-newtonian two- phase flow. Appl Sci 10:3272 20. Barooah A, Khan MS, Rahman MA, Hasan AR, Manikonda K, Abdelrazeq M, Sleiti AK, El-Naas M, Hascakir B (2021) Investigation of gas-liquid flow using electrical resistance tomography and wavelet analysis techniques for early kick detection. In: ASME 2021 40th international conference ocean offshore architectural engineering. https://doi.org/10.1115/ OMAE2021-63725 21. Busch A, Islam A, Martins DW, Iversen FP, Khatibi M, Johansen ST, Time RW, Meese EA (2018) Cuttings-transport modeling-part 1: specification of benchmark parameters with a Norwegian-continental-shelf perspective. SPE Drill Complet 33:130–148 22. Busch A, Werner B, Johansen ST, Industry S (2020) Cuttings transport modeling—part 2: dimensional analysis and scaling. SPE Drill Complet 35:069–087 3 Multiphase Flow Systems and Potential of Machine Learning … 53 23. Qureshi MF, Ali MH, Ferroudji H, Rasul G, Khan MS, Azizur M, Hasan R, Hassan I (2021) Measuring solid cuttings transport in Newtonian fluid across horizontal annulus using electrical resistance tomography (ERT). Flow Meas Instrum 77 24. Clark RK, Bickham KL (1994) Mechanistic model for cuttings transport. In: Proceedings SPE Annual Technology Conference on Exhibitions Delta, pp 139–153 25. Martins AL, Costapinto Santana C (1992) Evaluation of cuttings transport in horizontal and near horizontal wells - a dimensionless approach. In: SPE Latin America and Caribbean petroleum engineering conference, proceedings, pp 155–161 26. Wicks M (1971) Transport of solids at low concentration in horizontal pipes. Adv Solid–Liquid Flow Pipes Its Appl. https://doi.org/10.1016/b978-0-08-015767-2.50010-7 27. Tomren PH, Iyoho AWAJ (1986) Experimental study of cutting transport in directional wells. SPE Drill Eng 01:43–56 28. Nazari T, Hareland G, Azar JJ (2010) Review of cuttings transport in directional well drilling: Systematic approach. In: Society of Petroleum Engineers West North American Registration Meeting 2010 - Collaboration with Jt Meet Pacific Sect AAPG Cordilleran Sect GSA 1, pp 108–122 29. Gavignet AA, Sobey IJ (1989) Model aids cuttings transport prediction. J Pet Technol 41(916– 921):15417 30. Doron P, Granica D, Barnea D (1987) Slurry flow in horizontal pipes-experimental and modeling. Int J Multiph Flow 13:535–547 31. Brown NP, Bern PA, Weaver A (1989) paper SPE/IADC 18636 presented at the, New Orleans, Louisiana (February 28 – March 3 1989) 171. (1989) Cleaning deviated holes: new experimental and theoretical studies. In: SPE/IADC drilling conference 32. Flow T, Systems N turbulent flow of non-newtonian systems. AIChE J 5:189–204 33. Iyoho AW, Takahashi H Modeling cuttings transport in horizontal, eccentric wellbores. unsolicited Pap. In: SPE 27416 34. Kamp A, Rivero M (1999) Layer modeling for cuttings transport in highly inclined wellbores. In: Latin America and Caribbean petroleum engineering conference. https://doi.org/10.2523/ 53942-ms 35. Doron P, Barnea D (1993) A three-layer model for solid-liquid flow in horizontal pipes. Int J Multiph Flow 19:1029–1043 36. Nguyen D, Rahman SS (1996) A three-layer hydraulic program for effective cuttings transport and hole cleaning in highly deviated and horizontal wells. In: SPE/IADC Asia Pacific drilling technology 37. Wilson KC (1987) Analysis of bed-load motion at high shear stress. J Hydraul Eng 113:97–103 38. Ramadan A, Skalle P, Johansen ST (2003) A mechanistic model to determine the critical flow velocity required to initiate the movement of spherical bed particles in inclined channels. Chem Eng Sci 58:2153–2163 39. Zhang H, Li G, Huang Z, Tian S (2013) Mathematical model of critical velocity for cuttings transport in microhole drilling. SOCAR Proc 2013:39–46 40. Larsen TI, Pilehvari AA, Azar JJ (1997) Development of a new cuttings-transport model for high-angle wellbores including horizontal wells. SPE Drill Complet 12:129–134 41. Hopkins CJ, Leicksenring RA (1995) Reducing the risk of stuck pipe in the Netherlands. In: SPE/IADC drilling conference 42. Rubiandini RS (1999) Equation for estimating mud minimum rate for cuttings transport in an inclined-until-horizontal well. In: SPE/IADC middle east drilling technology conference 43. Tobena UC (2010) Hole cleaning and hydraulics. Universitetet i Stavanger 44. Shiddiq AMI, Christiantoro B, Syafri I, Abdurrokhim MBTH, Wattimury P, Resesiyanto H (2017) A comprehensive comparison study of empirical cutting transport models in inclined and horizontal wells. J Eng Technol Sci 49:275–289 45. Rose HE, Duckworth RA (1969) Transport of solid particles in liquid and gases. Engineer 227:478–483 46. Turian RM, Yuan T, Maurl G (1971) Pressure drop correlation for pipeline flow of sol id-Liq u id Suspensions, 17 54 M. S. Khan et al. 47. Mingqin D, Miska SZ, Mengjiao Y et al (2006) Transport of small cuttings in extended reach drilling. In: International oil gas conference exhibition China 2006 - Sustain growth oil gas, vol 2, pp 800–808 48. Thomas AD (1976) Scale-up methods for pipeline transport of slurries. Int J Miner Process 3:51–69 49. Iyoho AW, Horeth JM, Veenkant RL (1987) A computer model for hole-cleaning analysis. In: SPE Annual technical conference and exhibition 50. S. Naganawa TN (2006) Simulating transient behavior of cuttings transport over whole trajectory of extended reach well. In: IADC/SPE Asia Pacific drilling technology conference exhibition 51. Wang Z, Zhai Y, Hao X, Guo X, Sun L (2010) Numerical simulation on three layer dynamic cutting transport model and its application on extended well drilling. In: IADC/SPE Asia Pacific drilling technology conference exhibition 52. Sircar A, Yadav K, Rayavarapu K, Bist N, Oza H (2021) Application of machine learning and artificial intelligence in oil and gas industry. Pet Res. https://doi.org/10.1016/j.ptlrs.2021. 05.009 53. Rooki R, Doulati Ardejani F, Moradzadeh A (2014) Hole cleaning prediction in foam drilling using artificial neural network and multiple linear regression. Geomaterials 04:47–53 54. Ozbayoglu E, Miska S, Reed T, Takach N (2002) Analysis of Bed Height in Horizontal and Highly-Inclined Wellbores by Using Artificial Neuraletworks. In: SPE international thermal operations and heavy oil symposium. International Horiz well technology conference. https:// doi.org/10.2523/78939-ms 55. Rooki R, Rakhshkhorshid M (2017) Cuttings transport modeling in underbalanced oil drilling operation using radial basis neural network. Egypt J Pet 26:541–546 56. Al-Azani K, Elkatatny S, Abdulraheem A, Mahmoud M, Ali A (2018) Prediction of cutting concentration in horizontal and deviated wells using support vector machine. In: Society of Petroleum Engineers - SPE Kingdom Saudi Arab annual technical symposium and exhibition 2018, SATS 2018. https://doi.org/10.2118/192193-ms 57. Aliouane L, Ouadfeul SA (2014) Sweet spots discrimination in shale gas reservoirs using seismic and well-logs data. A case study from the Worth basin in the Barnett shale. Energy Proc 59:22–27 58. Castiñeira D, Toronyi R, Saleri N (2018) Machine learning and natural language processing for automated analysis of drilling and completion data. In: SPE Kingdom Saudi Arab annual technical symposium and exhibition. https://doi.org/10.2118/192280-MS 59. Dunlop J, Isangulov R, Aldred WD, Sanchez HA, Flores JL, Herdoiza JA, Belaskie J, Luppens JC (2011) Increased rate of penetration through automation. In: SPE/IADC drilling conference exhibition. https://doi.org/10.2118/139897-MS 60. Al-Azani K, Elkatatny S, Ali A, Ramadan E, Abdulraheem A (2019) Cutting concentration prediction in horizontal and deviated wells using artificial intelligence techniques. J Pet Explor Prod Technol 9:2769–2779 61. Sorgun M, Ozbayoglu AM, Ozbayoglu ME (2015) Support vector regression and computational fluid dynamics modeling of Newtonian and non-Newtonian fluids in annulus with pipe rotation. J Energy Resour Technol Trans ASME 137:1–5 62. Osman ESA (2001) Artificial neural networks models for identifying flow regimes and predicting liquid holdup in horizontal multiphase flow. Proc Middle East Oil Show 797–804 63. Sorgun M, Ulker E (2016) Modeling and experimental study of solid-liquid two-phase pressure drop in horizontal wellbores with pipe rotation. J Energy Resour Technol Trans ASME 138:1–5 64. Ozbayoglu EM, Ozbayoglu MA (2009) Estimating flow patterns and frictional pressure losses of two-phase fluids in horizontal wellbores using artificial neural networks. Pet Sci Technol 27:135–149 65. Ashena R, Moghadasi J (2011) Bottom hole pressure estimation using evolved neural networks by real coded ant colony optimization and genetic algorithm. J Pet Sci Eng 77:375–385 3 Multiphase Flow Systems and Potential of Machine Learning … 55 66. Ajani A, Kelkar M, Sarica C, Pereyra E (2016) Foam flow in vertical gas wells under liquid loading: critical velocity and pressure drop prediction. Int J Multiph Flow 87:1339–1351 67. El Fadili Y, Shah S (2017) A new model for predicting critical gas rate in horizontal and deviated wells. J Pet Sci Eng 150:154–161 68. Mandhane JM, Gregory GA, Aziz K (1974) A flow pattern map for gas-liquid flow in horizontal pipes. Int J Multiph Flow 1:537–553 69. Falcone G, Barbosa JR (2013) State-of-the-art review of liquid loading in gas wells. DGMK/ÖGEW-Frühjahrstagung 129–150 70. Tao G, He L, Liu W, Xu L, Xiong W, Wang T, Kou Y (2006) Preparation, characterization and application of amino acid-based green ionic liquids. Green Chem 8:639 71. Abdullahi MB, Sulaiman ADI, Abdulkadir U, Salaudeen I, Shehu BU (2019) Production optimization of liquid loading problem in offshore Niger delta gas condensate field. Society of Petroleum Engineers - SPE Niger annual technical symposium and exhibition 2019, NAIC 2019. https://doi.org/10.2118/198873-MS 72. Shekhar S, Kelkar M, Hearn WJ, Hain LL (2017) Improved prediction of liquid loading in gas wells. SPE Prod Oper 32:539–550 73. Okoro EE, Bassey CI, Sanni SE, Ashiq MGB, Mamudu AO (2019) Application of nonuniform film thickness concept in predicting deviated gas wells liquid loading. MethodsX 6:2443–2454 74. Kvandal H, Holm H, Valle A (2007) Liquid holdup in high pressure, low temperature, gascondensate flow with low liquid loading including hydrate inhibitor. In: 13th international conference multiphase production technology, pp 209–223 75. Kong R, Kim S (2017) Characterization of horizontal air–water two-phase flow. Nucl Eng Des 312:266–276 76. Kong R, Kim S, Bajorek S, Tien K, Hoxie C (2017) Experimental investigation of horizontal air–water bubbly-to-plug and bubbly-to-slug transition flows in a 3.81 cm ID pipe. Int J Multiph Flow 94:137–155 77. Du M, De JN, Gao ZK, Wang ZY, Zhai LS (2012) Flow pattern and water holdup measurements of vertical upward oil-water two-phase flow in small diameter pipes. Int J Multiph Flow 41:91–105 78. Turner RG, Hubbard MG, Dukler AE (1969) Analysis and prediction of minimum flow rate for the continuous removal of liquids from gas wells. J Pet Technol 21:1475–1482 79. Graf JF, Coleman MM, Painter PC (1991) 6710–6723 80. Li G, Yao Y, Zhang R (2016) An improved model for the prediction of liquid loading in gas wells. J Nat Gas Sci Eng 32:198–204 81. Fernandes RC, Semiat R, Dukler AE (1983) Hydrodynamic model for Gias-liquid slug flow in vertical tubes. AIChE J 29:981–989 82. Orell A, Rembrand R (1986) A model for gas—liquid slug flow in a vertical tube. Ind Eng Chem Fundam 25:196–206 83. Sylvester ND (1987) A mechanistic model for two-phase vertical slug flow in pipes. Trans Am Soc Mech Eng 109:206–213 84. de Cachard F, Delhaye JM (1996) A slugh-churn flow model for small-diameter airlift pumps. Int J Multiph flow 22:627–649 85. Waltrich PJ, Falcone G, Barbosa JR (2011) Performance of vertical transient two-phase flow models applied to liquid loading in gas wells. In: Proceedings - SPE annual technology conference exhibition, vol 5, pp 3568–3582 86. C.Alves MV, Falcone G, Barbosa JR (2012) Modeling the transient behavior of churn-annular flow in a vertical pipe. 3rd Brazilian Conference Boil Condens Multiph Flow, pp 7–9 87. Yang D, Ding Y, Du T, Mao S, Zhang Z (2018) Buoyant back-layering and the critical condition for preventing back-layering fluid in inclined tunnels under natural ventilation: brine water experiments. Exp Therm Fluid Sci 90:319–329 56 M. S. Khan et al. 88. Ming R, He H (2017) A new approach for accurate prediction of liquid loading of directional gas wells in transition flow or turbulent flow. J Chem. https://doi.org/10.1155/2017/4969765 89. Chen D, Yao Y, Fu G, Meng H, Xie S (2016) A new model for predicting liquid loading in deviated gas wells. J Nat Gas Sci Eng 34:178–184 90. Zhu Q-L, Xu Q (2015) Liquid organic and inorganic chemical hydrides for high-capacity hydrogen storage. Energy Environ Sci 8:478–512 91. Ansari AM, Sylvester ND, Sarica C, Shoham O, Brill JP (1994) A comprehensive mechanistic model for upward two-phase flow in wellbores. SPE Prod Facil 9:143–151 92. Barnea D (1987) A unified model for predicting transitions for the whole pipe inclinations. Int J Multiph Flow 13:1–12 93. Hakim H, Katende A, Sagala F, Ismail I, Nsamba H (2018) Performance of polyethylene and polypropylene beads towards drill cuttings transportation in horizontal wellbore. J Pet Sci Eng 165:962–969 94. Gaol AHL, Valkó PP (2016) Modeling wellbore liquid-content in liquid loading gas wells using the SPE. In: Low Perm Symposium Denver, Color, USA 95. Ikpeka PM, Okolo MO (2018) Title: Li and Turner Modified model for Predicting Liquid Loading in Gas Wells. J Pet Explor Prod Technol 9:1971–1993 96. Guo B, Ghalambor A, Xu C (2005) A systematic approach to predicting liquid loading in gas wells. SPE Prod Oper Symp 9 97. Cavalcanti de Sousa P (2013) Upward gas-liquid flow in concentric and eccentric annular spaces. Texas A&M University 98. Riza MF, Hasan AR, Kabir CS (2016) A pragmatic approach to understanding liquid loading in gas wells. SPE Prod Oper 31:185–196 99. Andreussi P, Persen LN (1987) Stratified gas-liquid flow in downwardly inclined pipes. Int J Multiph Flow 13:565–575 100. Alsaadi Y, Pereyra E, Torres C, Sarica C (2015) Liquid loading of highly deviated gas wells from 60° to 88°. In: SPE annual technical conference and exhibition, 18 101. Guner M, Pereyra E, Sarica C, Torres C (2015) An experimental study of low liquid loading in inclined pipes from 90° to 45°. In: SPE production and operations symposium proceedings 2015, pp 505–525 102. Skopich A, Pereyra E, Sarica C, Kelkar M (2015) Pipe-diameter effect on liquid loading in vertical gas wells. SPE Prod Oper 30:164–176 103. Dinaryanto O, Prayitno YAK, Majid AI, Hudaya AZ, Nusirwan YA, Widyaparaga A, Indarto D (2017) Experimental investigation on the initiation and flow development of gas-liquid slug two-phase flow in a horizontal pipe. Exp Therm Fluid Sci 81:93–108 104. Kesana NR, Parsi M, Vieira RE, Azzopardi B, Schleicher E, McLaury BS, Shirazi SA, Hampel U (2017) Visualization of gas-liquid multiphase pseudo-slug flow using wire-mesh sensor. J Nat Gas Sci Eng 46:477–490 105. Shaban H, Tavoularis S (2014) Identification of flow regime in vertical upward air-water pipe flow using differential pressure signals and elastic maps. Int J Multiph Flow 61:62–72 106. Al-Naser M, Elshafei M, Al-Sarkhi A (2016) Artificial neural network application for multiphase flow patterns detection: a new approach. J Pet Sci Eng 145:548–564 107. Ezzatabadipour M, Singh P, Robinson MD, Guillen-Rondon P, Torres C (2017) Deep learning as a tool to predict flow patterns in two-phase flow 108. Amaya-Gomez R, López J, Pineda H, Urbano-Caguasango D, Pinilla J, Ratkovich N, Muñoz F (2019) Probabilistic approach of a flow pattern map for horizontal, vertical, and inclined pipes. Oil Gas Sci Technol. https://doi.org/10.2516/ogst/2019034 109. Hernandez JS, Valencia C, Ratkovich N, Torres CF, Muñoz F (2019) Data driven methodology for model selection in flow pattern prediction. Heliyon 5:e02718 110. Almalki N, Ahmed WH (2020) Prediction of two-phase flow patterns using machine learning algorithms. In: International conference fluid flow, heat mass transfer, pp 182–1–182–9 111. Mask G, Wu X, Ling K (2019) An improved model for gas-liquid flow pattern prediction based on machine learning. J Pet Sci Eng 183:106370 3 Multiphase Flow Systems and Potential of Machine Learning … 57 112. Sami NA, Ibrahim DS (2021) Forecasting multiphase flowing bottom-hole pressure of vertical oil wells using three machine learning techniques. Pet Res. https://doi.org/10.1016/j.ptlrs. 2021.05.004 113. Alhashem M (2019) Supervised machine learning in predicting multiphase flow regimes in horizontal pipes. In: Society of petroleum engineers - Abu Dhabi international petroleum exhibition and conference. OnePetro, ADIP 2019. https://doi.org/10.2118/197545-ms Chapter 4 Machine Learning in Corrosion Jai Krishna Sahith Sayani and Bhajan Lal Abstract This chapter presents the advances and progress on the use of machine learning in corrosion. Specifically, the use of machine learning to predict corrosion rate in pipelines. Keywords Machine learning · Flow assurance · Corrosion · Predictions · Model 4.1 Introduction Corrosion is a common problem that occurs in every industrial sector. Corrosion has become a major crisis in each sector due to its effect that can influence the profit and loss in any production business. This is because when corrosion occurs, it can affect the quality and the quantity of the product produced thus, it requires maintenance to back to its original condition. More critical if corrosion becomes uncontrol, any unpredicted accident can happen that can cause events such as sudden burst, leaking, explosion, and a more serious case can involve a fatality. This chapter will include the corrosion mechanisms, factors that influence corrosion, and types of corrosion that can happen in the oil and gas industry. Besides, it also describes the mitigation procedures that can be done to minimize and control the corrosion as it is quite impossible to completely avoid the corrosion from keep occurring. Next, in implementing all the possible corrosion controls, it is important to determine the corrosion rate of the equipment in order to decide which method J. K. S. Sayani Department of Chemical and Bioprocess Engineering, University College Dublin (UCD), Dublin, Ireland B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_4 59 60 J. K. S. Sayani and B. Lal is the most suitable and the correct amount of corrosion inhibitor requires to minimize the corrosion rate if applicable. The corrosion rate can be determined based on experimental or computer simulation methods. These methods are also described in this chapter. Over the years, corrosion has become the main problem faced by every sector. Alternatives in determining the corrosion rate in terms of simulation have been developed to tackle this problem. Various corrosion prediction models have been developed based on the different operating conditions of the process involved. HYDROCOR, Cassandra, De Waard, NORSOK, Lipucor, ECE, and KSC are examples of the corrosion prediction model includes in this chapter. 4.2 Corrosion in Oil and Gas Industry 4.2.1 Corrosion Mechanism Corrosion has been a major crisis that occurs not only in the oil and gas industry but also in every processing plant. It can occur in every piece of equipment such as storage tank, pipeline, reactor, and distillation column whenever the corrosion factors exist. Some of the main factors of corrosion are oxygen, metal ion, and water vapour. Corrosion is the degradation process of material strength and its critical properties as a result of chemical, electrochemical, and other processes that involve the reaction between the exposed material surface and the surrounding environment. As corrosion can happen easily regardless of its severity level, a large amount of revenue has been allocated only for corrosion as whenever it happened, the recovery cost will include the maintenance, compensation, and installation of a new part of the affected equipment.7/8847 For example, in 2018 around $1.4 billion was spent by US oil and gas exploration and production industry only for corrosion purposes as reported by NACE International also known National Association of Corrosion Engineers. Therefore, this crisis must be overcome by implementing the steps in reducing the corrosion rate to avoid losing a large amount of revenue. It occurs when the reduction–oxidation (redox) reaction takes place as the substance transforms to a more stable form. The selection of which metal to undergo whether oxidation or reduction will be based on the standard electrode potential. For the metal with higher standard electrode potential, it will undergo reduction at the cathode side while the metal with lower standard electrode potential will likely undergo oxidation at the anode site. The anodic metal will likely become thinner throughout the redox reaction as it loses some of its electrons whereas, for the cathodic metal, it will become thicker due to the gaining electron process. 2M → 2M2+ + 4e− O2 + 2H2 O + 4e− → 4OH− (Anodic reaction) (Cathodic reaction) (4.1) (4.2) 4 Machine Learning in Corrosion 61 4.2.2 Corrosion Factors Environmental factor has been the main influence of corrosion to occur. Various types of corrosion can take place due to the existence of certain factors such as pH, pressure, temperature, and the presence of sulfides, acid, and carbon dioxide [1]. Increases in temperature can result in increasing corrosion rate since the collision frequency of ions increases. Even so, the corrosion rate increases with temperature, whenever the temperature reaches its peak point, the corrosion rate starts to decrease due to the formation of corrosion product on the metal surface avoiding the reaction between the metal surface with the corrosion agent. Next, an increase in pressure will result in increase flow velocity and directly lead to an increase in corrosion rate. This is because, at this condition, higher speed of the fluid able to remove the protective layer formed on the metal surface causing a more exposed area of metal and allowing corrosion to happen [2]. In addition, the presence of certain elements able to corrosion to happen. For example, an increase in the oxygen concentration is able to increase the corrosion rate since oxygen will likely undergo a cathodic reaction during the electrochemical process. However, for metals such as stainless steel, titanium, and aluminium, the presence of oxygen is able to maintain the protective oxide layer on these metals [3]. Therefore, the presence of oxygen can result in an increase and decrease of corrosion rate depending on the surrounding conditions. Moreover, the presence of carbon dioxide or hydrogen sulfide that dominant an area can classify whether it undergoes sweet corrosion or sour corrosion, respectively. This classification of corrosion can help in determining the suitable corrosion control to be implemented. Besides, the partial pressure of carbon dioxide also can be used to determine the corrosion severity of the equipment. For example, for carbon dioxide partial pressure (PPCO2 ) < 48 kPa, it can be considered as non-corrosive, 48 kPa < PPCO2 < 207 kPa can be considered as medium corrosion, and PPCO2 > 207 kPa can be considered as severe corrosion [4]. 4.2.3 Types of Corrosion General corrosion or also known as uniform corrosion or general attack corrosion is a type of corrosion that occurs at the same rate over the entire surface area of the metal that is exposed to the corrosion-causing conditions (Fig. 4.1). This happens due to the presence of acids, salts, and when oxidation and reduction reactions occur uniformly [1]. The uniformly occur electrochemical reaction results in thinning of the wall or surface thickness until failure occurs. However, the corrosion can be well managed by increasing the thickness of the exposed surface. Next, galvanic corrosion is corrosion that happens when the two dissimilar metals are placed together in a corrosive electrolyte (Fig. 4.2). For the metal with high corrosion resistance, it will become the cathode while the other metal will become the anode. This type of corrosion can happen due to the presence of acids, water, and the deposition of salts 62 J. K. S. Sayani and B. Lal Fig. 4.1 General corrosion on a metal surface [4] from sulfides and chlorides [1]. In the anode–cathode extend, the further the position of the two metals in the galvanic series, the lower the reactivity between the metals thus minimizing the galvanic corrosion. In addition, another type of corrosion that can happen is pitting corrosion (Fig. 4.3). This corrosion can be observed when there are holes, cavities, or pits formed on the metal surface. It is considered more dangerous than general corrosion due to its difficulty to be traced and predicted. This difficulty is because of the formation of corrosion product that forms on the metal surface that covers the holes and pits resulting in the unnoticeable pits. This type of corrosion involves three stages which are the formation of the surface layer on the metal surface, initiation of pits at localized regions where layer breakdown occurs, and followed by pit propagation and final material penetration. Moreover, intergranular corrosion is corrosion with the localized attack that occurs at grain boundaries or directly next to grain boundaries, leaving the majority of the grains intact. If this corrosion occurs, it may lead to loss of tensile properties and loss of cross-sectional thickness of the materials. This corrosion is likely to occur due to a fabrication process that involves heating or cooling where some of the material content can be reduced when undergoes the process. Lastly, many other types of corrosion can happen in the oil and gas industry such as crevice corrosion, microbial induced corrosion (MIC), erosion corrosion, stress corrosion, and intergranular corrosion. 4 Machine Learning in Corrosion 63 Fig. 4.2 Galvanic corrosion at three lead pipe joints [4] Fig. 4.3 Pitting corrosion on a metal surface [5] 4.2.4 Corrosion Control The selection of the most suitable corrosion control can be influenced by the chemical involved in the corrosion and the environmental conditions. The first thing that should be considered in the selection of construction material. There is no material that is 64 J. K. S. Sayani and B. Lal able to fulfill all the requirements. The most common material 0020 used is carbon steel due to its cheapness but the usage of carbon steel, especially in natural gas systems, must come with the application of the coating, cathodic protection, and injection of corrosion inhibitors to minimize the corrosion rate. Other than carbon steel, titanium alloy also can be used in natural gas as it is highly corrosion resistant due to the formation of TiO2 passive layer and also highly resistant to H2 S, CO2, and brine [6]. Besides, for the injection of corrosion inhibitor, it will be adsorbed and covered the metal surface. By increasing the concentration of the corrosion inhibitor, it able to reduce the metal surface exposed to the corrosion agent. There are multiple types of corrosion inhibitors that can be utilized such as anodic inhibitors, cathodic inhibitors, organic and inorganic inhibitors based on the purpose of the usage [3]. Prior to injecting the corrosion inhibitor into the equipment, it recommends doing some chemical cleaning such as pigging. For the reason that the effectiveness of the inhibitors can be reduced when the suspended solids and sand present as it will attract the molecules of the inhibitors. Apart from these two alternatives, there are other ways that can be utilized to minimize the corrosion rate such as cathodic protection and coating. All of these corrosion controls can be done based on the behaviour of the corrosion agents and the internal or external environmental conditions of the equipment involved. 4.3 Mitigation Procedures The severity of corrosion can be influenced by the material of construction. The selection of materials for the construction of the equipment is very vital as it will influence the capital expenditures (CAPEX) and operational expenditure (OPEX). Therefore, it is required to keep both balances by implementing the mitigation activities. Carbon steel is the most commonly used material in construction such as a pipeline. However, this application is only applicable with the implementation of corrosion control such as injection of inhibitors and cathodic protection. Other than carbon steel, materials such as stainless steel, alloy, and PVC have also been used as construction materials depending on the operating conditions of the process and the characteristics of the substances involved. 4.3.1 Pigging Pigging is a process where a device known as ‘pig’ is inserted in a pipeline that used the flowing fluid as the driving force. It can be categorized into three types based on its functionality such as cleaning pigs, sealing pigs, and in-line inspection (ILI). Cleaning pigs are used to remove the solid deposition, debris, wax, asphaltenes, and biofilms from the pipe whereas cleaning pigs are used to seal, sweep liquid (mainly 4 Machine Learning in Corrosion 65 water), apply corrosion inhibitors, coat the pipe, and separate products. Lastly, inline inspection (ILI) pigs are a tool that is utilized to inspect pipelines and are also known as intelligent pigs. It can be done on a variety sizes of pipelines as it will not interrupt and stop the flow of the materials flowing through the pipeline. Besides, pigging can be implemented in both metallic and non-metallic pipelines. Pigging is used to remove accumulated water and sediment in non-metallic pipes. During construction, operation and maintenance, inspection, repair and rehabilitation, and decommissioning, a pigging operation is carried out. Pigs exist in various shapes which used for different applications such as a sphere, cast, and multi-diameter. 4.3.2 Corrosion Inhibitor In addition, the usage of corrosion inhibitors has been one of the commonly used applications for corrosion control. Most construction in the oil and gas industry implement the usage of carbon steel for the equipment that is only possible with the assistance of corrosion inhibitors. This application is the most trusted, time-tested, and proven method that can be used especially in the production, transportation, and refinery sectors in the oil and gas industry. The characteristics of organic corrosion inhibitors that are commonly used in the oil and gas industry are organic, polar, and surface-active molecules. It is made up of mixtures containing active ingredients for inhibitors, hydrate inhibitors, antifoaming agents, and more but rarely made up of pure substance. The application of corrosion inhibitors is by injecting a small concentration of the chemical substance into the corrosive media to decrease or prevent the reaction between the metal and the media. Then, the inhibitors will operate by the adsorption of ions or molecules onto the metal surface. The injection of corrosion inhibitors to the corrosive media is able to reduce the corrosion rate of the media by increasing or decreasing the anodic and/or cathodic reaction, decreasing the diffusion rate for the reactant to the surface of the metal, and decreasing the electrical resistance of the metal surface. In addition, the selection of corrosion inhibitors depends on some factors such as cost, availability, toxicity, and biodegradability. The usage of the natural product as the corrosion inhibitor has been considered previously but the usage has already been banned due to its toxicity towards human beings and the environment. This case same goes for the organic compound that contains nitrogen, oxygen, or sulfur that has significant inhibition efficiency but is not being used due to expensive and toxic to the environment. Therefore, the existence of plant extract as a corrosion inhibitor has been one of the options of corrosion inhibitor. This is because plant extract is a renewable source of inhibitor, readily available, and environment-friendly other than it has very high inhibition efficiency. It is believed that the presence of heterocyclic constituents like alkaloids and flavonoids causes the possibility of plant extract to be a corrosion inhibitor. 66 J. K. S. Sayani and B. Lal Based on the study done on the effectiveness of non-ionic surfactants as corrosion inhibitors which are aniline and ethoxylated aromatic amine, it is found that by increasing the concentration of corrosion inhibitor, the corrosion rate decreases and the inhibition efficiency also increases [7]. 4.3.3 Internal Coating Coating can be one of the options to control the corrosion rate. Some confusion might happen from the words of liner and coating which liner can be referred to as the materials used to protect the internal surface whereas coating can be referred to as the materials used to protect the external surface. In minimizing or preventing the corrosion rate, both protection from the internal coating and external coating can be done. Various types of coating can be used for the internal protection of the surface. For examples are polymeric liners, clad materials, and refractive index. The consideration of polymeric liner as an internal coating is due to its properties such as adhesion, abrasion resistance, ability to withstand rapid changes of pressure without blistering or flickering, elasticity to withstand stresses during construction, and ability to withstand welding temperature. Moreover, properties like electrical resistivity, aging, water and moisture resistance, flexibility, resistance to a salt solution, solvent, hydrocarbon, and wet H2 S gas are other properties that are also taken into account during the selection of polymeric liner. Different types of polymeric liners have different properties that are suitable for only certain functions. The most widely used liners in the oil and gas industry are epoxies and vinyls other than phenolics, furans, neoprenes, and alkyds. Refractive index is another internal coating that can be used for reducing the corrosion rate. This liner typically is used for the surface material that is exposed to high temperatures such as in refineries. This liner typically has a range of thickness between 25 and 100 mm. The performance of this liner can be measured from its installation, materials, process, and fabrication. Some examples of the materials used for refractories are silica, chromium oxide, silicon nitride, and alumina. 4.3.4 External Coating Pipeline corrosion can happen in the external and internal of the pipeline due to exposure to the corrosion factors. As for corrosion that occurs outside the pipeline, the corrosion control can divide whether exposed to the atmosphere or exposed to the underground environment. For the corrosion that happened due to atmospheric exposure, the corrosion can be controlled by implementing the electrically insulated coating. The various coating can be used, for example, polymetric coating, metallic or thermal spray coating, girth weld coating, insulator, and concrete coating. 4 Machine Learning in Corrosion 67 Polymetric coating is an anti-corrosion coating that is applied to the above-ground structure and to buried infrastructures. Some of the usages of this coating are in the 1980s, extruded three-layers coatings were used with an inner fusion bonded epoxy (FBE) layer, an adhesive layer, and an outer polyolefin (polyethylene or polypropylene) layer. In the 1990s, the composite coatings were used, with an inner FBE, a graded layer of FBE, and modified polyethylene, and followed by an outer polyolefin layer. Some examples of the materials used as polymetric coating are coal tar, asphalt, and extruded polyolefins. Next, girth weld coating is used during pipeline construction as a protective fluid coating that is placed to the metal surface of two pipes that have been linked throughout their circumference. It is also known as joint coatings since it is commonly applied to protect weld-joint. Some types of girth-weld coatings that have been used in the oil and gas industry are tape coating, heat shrinkable coating, polyolefin, and powder epoxy. Tape coating can be applied based on the type of application whether it is a hot or cold application with different maximum operating temperatures. Each of the applications has its tape that can be used as each tape has its own characteristics. For example, the bituminous tape is a single and multi-layer tape that can be applied with or without primer whereas petrolatum is a single and multi-layer tape that must be applied with primer. It also has a typical maximum operating temperature of 30 °C. Next, heat shrinkable coating is a protective coating in form of a wraparound or tubular sleeve for the pipeline that consists of an adhesive and an extruded polyolefin outer layer. This coating will shrink in size and adapt to the surface it is surrounded by whenever the heat is applied to it. The shrinking process of the coating is caused by the polyolefin contained in the sleeve which also the uniqueness of this coating. The types of heat-shrinkable coating can be classified into two, whether with primer or without primer. Each of the tapes has its maximum operating temperature as an indicator for the selection of tape during the decision-making process. For example, polyethylene with no primer has a maximum operating temperature of 50 °C. In addition, liquid epoxy, urethane, vinylester, wax, elastomeric, and visco-elastic coatings are the other types of girth weld coating. Besides, metallic coating or also known as thermal spray coating is used for applications such as wear resistance, corrosion resistance, bioactivity, and dielectric properties of light metal [8]. This coating protects the steel from these problems by acting as a barrier coating or sacrificial anode It is also widely used in industrial sectors such as biomedical, automotive, and aerospace as a protective coating due to its suitability to be applied to all types of materials such as pure metals, metal alloys, oxide ceramics, cermets, plastics, and hard metals (carbides). However, materials that can easily decompose irreversibly during melting, not stable during melting, and vaporize excessively in the spray process are not suitable for this coating [9]. Silicon ceramics and magnesia are examples of materials that are not suitable for this type of coating. 68 J. K. S. Sayani and B. Lal 4.3.5 Cathodic Protection Cathodic protection is an electrical method for corrosion control for the metallic structure that is widely used in the underground system. For examples of the system are lead cables, water treatment equipment, steel piling, well casing, and water storage tank. In this method, there is the involvement of current that flows from the more negative potential metal to more positive potential metal through an electrolyte. Some corrosion types that can be related to this protection method are electrolytic corrosion and galvanic corrosion. Electrolytic corrosion occurs due to the existence of current from an external source that enters and leaves a particular metallic structure through an electrolyte. This type of corrosion mechanism is also called stray current corrosion in the underground work. Next, galvanic corrosion occurs due to the differences in the electrolyte such as soil resistivity, oxygen concentration, moisture content, and various ion concentration. The cathodic protection mechanism requires an anode, a cathode, and an electrolyte to occur. For the cathode or the structure to be protected, the commonly used materials are made up of iron, steel, and stainless steel however, there are other metals that also can be used as a cathode such as lead, sheathed cable, copper, and aluminium piping, galvanized steel, and cast iron. Moreover, the widely used electrolyte is soil or water but there are also some unusual electrolytes that can be used successfully which are concrete, calcium chloride, and caustic soda. In conducting the cathodic protection, there are two methods that can be applied which are impressed current cathodic protection and sacrificial anode cathodic protection. Firstly, impressed current cathodic protection requires the anode to be energized by an external direct current (DC) power source which the anode will be then installed in an electrolyte and connected to the positive terminal of the DC power source. For the structure that to be protected, it will be connected to the negative terminal of the power source. This method is also known as a rectifier system. Next, for the anode of this method, it requires the one that has longer life as it will corrode during the process. Examples of the anode are graphite, high silicon cast iron, and precious metal oxide coated titanium. Secondly, the sacrificial anode cathodic protection requires the usage of the galvanic anode with a higher energy level or potential compares to the structure to be protected. In addition, the anode of this method can be whether magnesium or zinc whereas the structure to be protected can be made up of material such as iron or steel. However, the selection of the anode and structure can be done based on the electromotive force series where the lower material in the ranking will be the anode. 4.3.6 Process Optimization Process optimization is another method that can be used for corrosion control. This method is implemented by altering the environment of the equipment or pipeline to 4 Machine Learning in Corrosion 69 make it not corrosion favorable. The operating condition such as pH, temperature, pressure, and flowrate will play the important role in this method. However, this method can be said to be expensive and sometimes impractical environment. 4.4 Corrosion Prediction Models The Corrosion prediction models are used to estimate and predict the corrosion rate of the equipment of the pipeline. This can be done during the designing of the equipment in order to plan or strategize the corrosion control measure that needs to be implemented to minimize the corrosion that might occur. Several corrosion predictions models have been developed with different environmental factors, limitations, and philosophies during the development of the models. The prediction model can be classified as a mechanistic, empirical, or semi-empirical model. For a mechanistic model, it has a strong theoretical background and considers the mechanisms of basic reactions such as chemical, electrochemical, and transport processes. Whereas the empirical model has a very little theoretical background with a foundation of a set of basic empirical correlations. For the semi-empirical model, it is partly based on well-established theoretical hypotheses. They are expanded for practical reasons to regions where there is insufficient theoretical knowledge in such as way that the extra phenomena may be explained empirically [10]. It is observed that for the cases of lack of corrosion or very low corrosion rate, it happened because of the formation of protective films and/or oil wetting factors [11]. Institute for Energy Technology (IFE) has conducted several discussions with corrosion experts from different oil companies such as Saudi Aramco, Shell, Chevron, and BP. The outcome from these meetings is a guideline for the use of a CO2 corrosion prediction tool that can be used to estimate the corrosion rate in the oil and gas industry. Some of the prediction models that have been evaluated from the IFE joint projects are as follows: • HYDROCOR • CORPLUS • KSC MODEL • MULTICORP • NORSOK model • De Waard model • Cassandra • ECE model • PREDICT • Corpos • SweetCor • Tulsa model • OLI model • ULL model 70 J. K. S. Sayani and B. Lal 4.4.1 Hydrocor HYDROCOR model is a mechanistic model developed by Shell. This model is a combination of corrosion and fluid flow modeling with a few assumptions. The flow considered for this model is extended to slug flow which brought to a mean that it ignores the bubble collapsing in the slug mixing zone [12]. It also assumed that there is no protection film during the presence of water formation and weak protection film for condensed water cases [13]. Oil wetting factor is considered when the water cut is below 40% and liquid velocity is above 1.5 m/s however, this consideration is only valid for crude oil systems but not for gas condensate [14]. For this model, it requires the inlet pressure and temperature, mole percentage of CO2 and H2 S, production rates, bicarbonate, organic acid, glycol content, and pipe diameter as the main input parameters. Some additional information that is also required is oil type (gas condensate or crude oil) and water type (condensed water or formation water). This model considers the small effect of protective films and less sensitivity of the variation of pH. 4.4.2 Cassandra Cassandra is a predictive tool from BP that considered the corrosion in multiphase flow. For this model, it considered a weaker effect of protective layer at high temperature than in the de Waard model but does not specify the effect for the cases whether with or without the water formation [12]. This model requires temperature, total pressure, liquid velocity, water chemistry, and mole percentage of CO2 as the main input parameters. Other information that also can be used if available are glycol concentration, oil type (condensate or crude oil), water type (condensed water or formation water), hydraulic diameter, and presence of acetic acid. This model also considers the relatively little effect of protective films and pH but not the oil wetting effect [14]. 4.4.3 De Waard The De Waard model is a semi-empirical model that was originally developed by De Waard and Milliams in 1975. It has been revised several times due to the correction factors added to the original correlation that considered the effect of pH and little consideration on the formation of the protective film [13]. For the first version that developed in 1975, the dependency of the correlation is temperature and CO2 partial pressure. Some correction factors have been introduced in the 1991 version and 1993 version, which respected the effect of pH and corrosion product, and effect of fluid velocity, respectively. For the correlation that was revised in 1995, it takes 4 Machine Learning in Corrosion 71 into consideration the effect of mass transport, fluid velocity, and steel composition. The requirement of main input parameters only takes water cut, temperature, liquid velocity, CO2 partial pressure, and pH. For the information that can be used depending on its availability are hydraulic parameters, oil type (condensate or crude oil), water type (condensed water or formation water), total pressure, and glycol concentration. The consideration of protective films is only when no presence of formation water as it is neglected because of the possibility to break down when with the presence of formation water. It also assumed that for water cut below 30% and liquid velocity above 1 m/s, oil wetting and no corrosion occurs but only for crude oil system, not for condensate [14]. 4.4.4 NORSOK NORSOK model is an empirical model developed by the Norwegian oil companies Statoil, Norsk Hydro, and Saga Petroleum. It takes into account the effect of protective layers especially at higher temperatures and higher pH. The range of temperature that can be applied to this correlation has been wider than the original one as it considers temperature from 5 to 150 °C [15]. The major input parameters required by this model are glycol concentration, pH, temperature, total pressure, CO2 content, and wall shear stress. The calculation of pH can be based on three ways; pH will be based on temperature and CO2 partial pressure for the condensed water without corrosion product, pH can be calculated for the pH in condensed water saturated with iron carbonate produced, and pH will be based on specified bicarbonate content and ionic strength from water analysis for pH of formation water [14]. This model does not consider the effect of oil wetting Scales. 4.4.5 Lipucor Lipucor model is an empirical model developed by Total that has two versions. The first version is a point model that the calculation of the flow regime will be at one point in a pipeline or well and a version that is based on fluid flow model which developed by the collaboration of Total, Elf, and Institute Français du Pétrole [14]. The parameters such as mole percentage of CO2 and H2 S, water chemistry, total pressure, pipe diameter, production rates, and temperature are the major input required. For the other information that can be used depending on its availability are steel composition, oil density, and gas molar weight. For this model, the pH has a relatively small effect on the corrosion rate, yet the calculation of pH will be based on the water chemistry, temperature, and CO2 content. The oil wetting factor is considered in this model. By utilizing this model, it is capable to indicate the corrosion type (general or localized) and the severity of the corrosion that might happen. 72 J. K. S. Sayani and B. Lal 4.4.6 ECE Electronic Corrosion Engineer or ECE model is developed by Intetech which inspired by the De Waard 95 model but includes a module for calculating pH from water chemistry and bicarbonate produced by corrosion, as well as an additional correlation for the influence oil wetting. The oil wetting factor is considered in this model which is based on a light crude oil field’s tube corrosion and determined by the density of oil, flow inclination, and liquid flow velocity [14]. 4.4.7 KSC KSC model is a mechanistic model that developed at Institute for Energy Technology. Electrochemical reactions at the steel surface, chemical reactions in the liquid phase, species diffusion to and from the bulk phase, diffusion via porous corrosion films, and precipitation of iron carbonate in the corrosion film are all simulated in this model. The corrosion rate that calculated by this model can be with and without protective films but for the calculation without protective film, it will be used for the calculation for risk of mesa attack [14]. The main input parameters required by this model are CO2 partial pressure, pH, total pressure liquid flow velocity, and temperature. This model does not consider the oil wetting factor but the protective layer factors that are considered is sensitive to pH and temperature. 4.5 Machine Learning in Corrosion TIn the oil and gas industry, corrosion can occur in any sector whether upstream, midstream, or downstream. Any area of metal that is exposed to corrosion factors such as oxygen, hydrogen sulfide, and carbon dioxide can lead to a corrosive environment. Since the upstream sector involves the exploration and production process of crude oil and natural gas, corrosion tends to occur during the drilling process when the equipment exposes to any corrosion factors. Moreover, in order to sustain the oil production, the reservoir will be injected with water to increase the internal pressure. Excess exposure towards high water cut, temperature, and pressure can lead to a corrosive environment resulting in corrosion to occur. Next, the midstream sector relates to the transportation of raw materials, products, and transition substances to downstream sectors. This transportation includes crude oil, natural gas liquid (NGL), liquid petroleum products, oilfield steam, condensate, oilfield water, multiphase fluids, gas, and liquid or dense phase CO2 . In the midstream sector, pitting & crevice corrosion have a high chance to occur in the equipment such as pipeline, fittings, flanges, valves, bolting, and gaskets. As the transportation of products involves various types of fluid, the factors that influence corrosion to occur 4 Machine Learning in Corrosion 73 are also different. For example, corrosion factors for oil pipelines are water holdup, solid deposition, bacteria, velocity, CO2 , H2 S, and oxygen ingress whereas corrosion factors for the gas pipelines are solid deposition, methanol, elemental sulfur, water holdup, critical gas velocity, polysulfides, H2 S, CO2 , oxygen ingress, bacteria, and chlorides. Lastly, corrosion factors for water pipelines are microorganisms, scale formation, oxygen ingress, solid accumulation, CO2 (aq), and H2 S (aq). All the raw materials found in upstream will be transported to downstream through midstream. In downstream, all the raw materials will be processed prior to the purpose of the sale. This is the sector where the crude oil refineries, petrochemical plants, and petroleum product distribution take place and if the corrosion is not well controlled, it can affect the production period and cost. A scheduled shutdown or turnaround is a common thing that happens in downstream in order to perform maintenance and repair the equipment however if uncontrol corrosion happens, frequent unscheduled shutdown can lead to an increase in the cost of maintenance and production loss. Moreover, as some equipment requires to be opened during maintenance, it will increase the chances of the internal equipment to be exposed to air and moisture which can influence corrosion and stress corrosion cracking (SCC) to occur [4]. In investigating and determining the corrosion rate can be done by experimental method or computer simulation method. For the experimental method, the corrosion rate can be determined by observing the weight loss experienced by the materials or using the Tafel extrapolation method while for the computer simulation method, a machine learning application can be implemented to predict and determine the corrosion rate. 4.5.1 Weight Loss Method The weight loss method is one of the methods that can be used to determine the corrosion rate experimentally. However, this method is time-consuming as there is no driving force applied during the experiment. The change of weight of the metal specimen after being removed from the environment will be weighed and the corrosion rate will be calculated based on the formula as follows [16]. Corr osion Rate(C R) = KW ρ At where K = constant, 534 W = weight loss in milligram (mg). ρ = density of the metal sample in gram per cubic centimetre (g/cm3 ). A = sample area in square inch (in2 ). t = time of immersion (exposure) in hours (h). CR = corrosion rate in milli-inch per year. (4.3) 74 J. K. S. Sayani and B. Lal 4.5.2 Tafel Extrapolation Method The Tafel extrapolation method is another method to determine the corrosion rate of material by estimating the corrosion current or corrosion potential in an electrochemical cell. This method is faster than the weight loss method is it involves an electric current that can act as the driving force. It is an accurate method as it considers all the reactions that involve in the corrosion. This consideration is made based on the assumption of simple electrochemical kinetics, to represent the mixed potential theory, predict the corrosion rate and potential based on the kinetics and thermodynamics of all the reactions occurring on the electrode surface. In determining the corrosion rate, a Tafel graph is plotted in order to determine the Tafel slope that will be required in the calculation of corrosion rate based on the formula as follow: 1 ) i corr = ( )( c 2.303R p ββaa ×β +βc ) ( i corr × t × M × 10 V = F ×S×d (4.4) (4.5) where i corr = corrosion current density in amperes per square centimetre (A/cm2 ) R p = corrosion resistance in ohms square centimetre (Ω cm2 ). βa and βc = Tafel slopes. V = corrosion rate of polarization in millimetre per year (mm/year). t = immersion time. M = equivalent molar weight in gram per mol (g/mol). F = Faraday constant (96,500 C.mol−1 ). S = surface area of electrode. d = density of iron. 4.5.3 Machine Learning Over the years, various studies have been done related to predicting corrosion rate or corrosion behaviour using the machine learning approach. Both machine learning and experimental approaches have been used however, the machine learning approach has been a hot topic lately due to the world migration into Artificial Intelligence (AI) and more accurate outcomes compared to experiments. Most of the studies done on this corrosion topics majority are using neural network technique for the machine learning part. According to the study of prediction of pipeline internal corrosion profile, it was found that the technique used was feedforward neural networks which was a part of the neural network learning approach. De Masi et al. [17] proposed the usage of the Levenberg–Marquardt back propagation algorithm in predicting the internal corrosion profile of a pipeline and in identifying 4 Machine Learning in Corrosion 75 the pipeline sections that were critically exposed to the corrosion risk. In this study, three types of input variables were alternated with another three output variables in achieving the objectives of the study. The three types of input variables were geometrical pipeline characteristics, fluid dynamic multiphase variables, and deterministic models whereas the three output variables were corrosion rate, metal loss, and area of defects. In this study, the correlations used to estimate the corrosion rates were de Waard and NORSOK model. Next, referring to the study done by Canonaco et al. [18] that observed the behaviour of three types of machine learning on internal corrosion of pipeline, all the input data used which were geometrical variables and fluid dynamical variables were supplied from the Pipeline Inspection Gauge (PIG) and dynamic multiphase flow simulator (OLGA), respectively. For the performance of the learning algorithms which were Support Vector Machine (SVM), Neural Network, and XGBoost, it split the data into two sets with 80% for the training set and 20% for the test set. It also used cross-validation on the training set to maximize the performance of the learning algorithm. In this study, it showed that Support Vector Machine (SVM) was able to capture all of the phenomenon’s components better than XGBoost and Neural Network. In addition, the study of corrosion rate prediction using ANN in a carbonated mixture of MDEA-based solution showed that the ANN model showed a better performance compared to the SVM model [8]. In this study, the Levenberg– Marquardt BP algorithm was also chosen due to its smallest mean square error (MSE) and the lowest training time. From the results obtained, it showed that pH, solution type, and conductivity of the solution showed a higher correlation coefficient compared to the PZ, DEA, and MEA concentrations to corrosion rate. Based on the study on the identification of the crucial factors of corrosion done by De Masi et al. [17], it used an artificial neural network (ANN) as it was the most useful application for the prediction of internal corrosion. The input and out parameters used in this study were based on the historical and current operating data of the pipeline. For the input parameters, it used four categories of data which were hydrocarbon characteristics, geometrical pipeline characteristics, fluid dynamic multiphase variables, and deterministic models whereas the output parameter was corrosion volume loss. For the first category of the input parameters, it only included CO2 partial pressure, the second category includes elevation, inclination, and concavity of each segment, the third category includes flow regime, hold-up, pressure, gas flow, total flow, liquid velocity, and gas velocity, and lastly, the fourth category includes de Waard and NORSOK. For the evaluation of the dependency between the observed corrosion and the variables, Mutual Information (MI) analysis was used. This study concluded that at the finest scale of the region exposed to corrosion that at 10 m, it was found that hold-up, concavity, liquid velocity, and gas velocity had the highest influence on corrosion which were at 0.84, 0.64, 0.60, and 0.50 of the Mutual Information. From the studies, all the findings obtained show that in determining the most suitable and accurate algorithms and the number of hidden neurons, a trial and error method is used as each of the options has its preferable environment to operate with. 76 J. K. S. Sayani and B. Lal This machine learning method also can be the fastest method to be used in predicting the corrosion rate of equipment depending on the size of the dataset used. 4.6 Case Study Throughout the years, there are many studies done on the prediction of corrosion rate using the machine learning approach. Various studies were done on this corrosion rate prediction using the machine learning approach with different operating conditions and the algorithms utilized in achieving the objectives. For the study done on the prediction of the lifetime of a pipe by Shaik et al. [19], it showed that corrosion played the most important role in the factor that influence the lifetime of the pipeline using the Artificial Neural Network (ANN) approach. In this study, there were two sections which were the machine learning development and sensitivity analysis. For the machine learning part, it was performed based on the corrosion, wall thinning, age, external diameter, pressure, thickness, and product type as the input, and the pipe condition target was the output. The data used in this study was based on the real-time operating data from the risk inspection date. In conducting the machine learning, the data samples were divided into three groups with 70%, 20%, and 10% for the training set, testing set, and validation set purposes. As for the training algorithm implemented in this study, it used the Levenberg–Marquardt algorithm as it was the fastest Back Propagation (BP) algorithm. As ANN consisting of three layers that included input, hidden, and output layers, the machine learning model was developed by implementing 7 neurons in the input layer that represented all the input parameters, 10 hidden neurons in the hidden layer, and 1 neuron in the output layer that represented the pipe condition target as the output of the machine learning model. In addition, the sensitivity analysis was done with the purpose to determine the correlation or the impact of each factor of the machine learning’s input on the pipe life condition which was the output of the machine learning. From this analysis, it found that corrosion was the factor with the highest negative impact on the pipe condition with 44% compared to other factors. It can be explained that increasing corrosion will affect decreasing pipe conditions. This study concluded that the machine learning developed was considered as successful reflecting on the coefficient of determination (R2 ) value obtained from the training, testing, and validation performed which were 0.9927, 0.9953, and 0.9842, respectively. Next, based on the study done by Diao et al. [20] on the influence of the chemical composition of low-alloy steel and environmental factors on the corrosion rate, it was found that both factors affect the corrosion rate of the pipe. In determining the key factors of the corrosion rate, the combination of gradient boosting decision tree (GBDT) and Kendall correlations were used due to its higher coefficient of determination (R2 ) in the training and testing sets compared to the principal component analysis (PCA) method. The R2 values for both training and testing sets of the preferred method were 0.94 and 0.92, respectively. Based on this method, the key factors that 4 Machine Learning in Corrosion 77 had the highest influence on corrosion rate were maximum dissolved oxygen content, maximum seawater salinity, minimum pH value, and mean temperature for the environmental factors whereas Cr, C, Si, P, and S contents for the materials factors. After the determination of key factors, machine learning was developed with all the key factors as the input and corrosion rate as the output. For the machine learning development, it used Phyton and random forest algorithm as the modeling algorithm. This was because the random forest algorithm had the highest coefficient of determination (R2 ) and root-mean-square error (RMSE) compared to the k-nearest neighbor model, multilayer perceptron model, support vector regression model with radial basis function kernel, linear kernel, and polynomial kernel. In the machine learning development, the data samples were divided into training and testing sets. The division of the groups was based on 40%, 50%, 60%, 70%, 80%, and 90% for the training set and the remaining for the testing sets. In this study, the development of machine learning implemented the random forest approach with 80% for the training set and 10% for the testing set. This was due to above 80% of the training set causing the accuracy of the model started to decrease which was believed to be caused by overfitting. Lastly, for the prediction of corrosion rate based on the key factors, the features λ– , V – , EN p– and ΔH f– under method II were selected for the prediction of corrosion rate due to its higher accuracy in terms of RMSE and R2 compared to the method I that utilized the usage of EN s , K, Rm, and Rc features. The R2 of method II for the training and testing sets were 0.91 and 0.90, respectively. Thus, based on the values of R2 and RMSE for the chosen method used, it showed that the machine learning developed was reliable for the corrosion rate prediction. Besides, Pei et al. [21] proposed the usage of the random forest machine learning approach to study the relation of corrosion rate on the environmental factors. Among all the listed environmental factors investigated which were temperature, relative humidity, rainfall, sulfur dioxide, nitrogen dioxide carbon monoxide, ozone, and particulate pollutant, only the first three parameters were considered as the key factors that influence the corrosion rate. This was due to its higher importance index compared to others. The importance index was determined using the random forest method. for the machine learning development, the data samples were split into two groups which were 90% for the training set and the remaining 10% for the testing set. This study also included the results for the Artificial Neural Network (ANN) and support vector regression (SVR) other than the random forest for comparison purposes. By considering the three key factors as the input and atmospheric corrosion monitoring current (IACM ) as the output of the machine learning, the random forest had the highest accuracy in terms of R2 compared to ANN and SVR. The R2 values for the training and testing samples were 0.526 and 0.457, respectively. In addition, another machine learning model was developed known as the corrected model. This corrected model included the formation of rust on the atmospheric corrosion monitoring (ACM) sensor as one of the inputs. This consideration caused the R2 of the random forest to increase from 0.526 to 0.940. For this corrected model, the random forest method still had the highest R2 than ANN and SVR with 0.94 for both training and testing samples. The consideration of rust formation was 78 J. K. S. Sayani and B. Lal due to when the atmospheric corrosion occurred, the layer of the steel electrode became thicker and the roughness of the surface increased due to the rust formation. This situation led to enhancement ability by the sensor surface to collect moisture and decrease in the critical relative humidity to generate the IACM output. This study concluded that the corrected random forest model was a better machine learning model to be used for the prediction of corrosion rate as the number of the samples correctly predicted and the accuracy rate was higher than the first random forest model developed with 6196/6540 and 94.7%, respectively. References 1. Fajobi M, Loto RT, Oluwole L, Fajobi MA, Loto RT, Oluwole OO (2019) Corrosion in crude distillation overhead system: a review energy absorption improvement of circular tubes View project Electrochemical analysis of the synergistic effect and corrosion inhibition property of quaternary ammonium surfactants and derivatives. J Bio-and Tribo-Corros 5:67 2. Abbas M (2016) Modelling CO2 corrosion of pipeline steels. Newcastle University 3. Groysman A (2017) Corrosion problems and solutions in oil, gas, refining and petrochemical industry. Koroze a Ochr Mater 61:100–117 4. Al-Janabi YT (2020) An overview of corrosion in oil and gas industry: upstream, midstream, and downstream sectors. Corros Inhib Oil Gas Ind 1–39 5. Tang K, Wilkinson S (2020) Corrosion resistance of electrified railway tunnels made of steel fibre reinforced concrete. Constr Build Mater 230:117006 6. Kane R, Craig S, Venkatesh A (2009) Titanium alloys for oil and gas service: a review. Corros 7. Migahed MA, Abd-El-Raouf M, Al-Sabagh AM, Abd-El-Bary HM (2005) Effectiveness of some non ionic surfactants as corrosion inhibitors for carbon steel pipelines in oil fields. Electrochim Acta 50:4683–4689 8. Li CJ (2010) Thermal spraying of light alloys. In: Surface engineering light alloy. Woodhead Publishing, pp 184–241 9. Petri V (2014) Thermal spray coating processes. In: Comprehensive Materials Processing, 1st ed, pp 229–276 10. Senouci A, Saeed El-Abbasy M, Elwakil E, El-Abbasy MS, Zayed T, Asce M (2014) Fuzzybased model for predicting failure of oil pipelines destructive analysis-based testing for curedin-place pipe view project toward clean water: avoid intrusion of contaminants into water systems. View project fuzzy-based model for predicting failure of oil pipelines. J Infrastruct Syst 20:375–387 11. Olsen S, Halvorsen A, Lunde P, Nyborg R (2005) CO2 Corrosion prediction model-basic principles. Corros 12. Wang H, Cai J-Y, Jepson WP (2002) CO 2 Corrosion mechanistic modeling and prediction in horizontal slug flow. In: Corros. 2002. OnePetro, p 02238 13. Nyborg R (2009) Guidelines for prediction of CO 2 corrosion in oil and gas production systems. Inst energiteknikk 1–16 14. Nyborg R (2002) Overview of CO2 corrosion models for wells and pipelines. Corros 15. Norsork Standard (2005) CO2 Corrosion rate calculation model. Majorstural, Norw Nor Technol Stand Inst Oscarsgt 20 16. Adeyanju O, Oyekunle LO (2009) Experimental investigation of the effects of different environmental conditions on pipelines corrosion rates. In: oSPE Niger annual international conference and exhibition 2009 17. De Masi G, Vichi R, Gentile M, Bruschi R, Gabetta G (2014) A neural network predictive model of pipeline internal corrosion profile. In: 1st International conference on systems informatics, modelling simulations 2014, pp 18–23 4 Machine Learning in Corrosion 79 18. Canonaco G, Roveri M, Alippi C, Podenzani F, Bennardo A, Conti M, Mancini N (2021) A machine-learning approach for the prediction of internal corrosion in pipeline infrastructures. In: IEEE International instrumentation and measurement technology conference 2021, pp 1–6 19. Shaik N, Pedapati S, Dzubir FAB (2022) Remaining useful life prediction of a piping system using artificial neural networks: a case study. Ain Shams Eng J 13:101535 20. Diao Y, Yan L, Gao K (2021) Improvement of the machine learning-based corrosion rate prediction model through the optimization of input features. Mater Des 198:109326 21. Pei Z, Zhang D, Zhi Y, Yang T, Jin L, Fu D, Cheng X, Terryn HA, Mol JM, Li X (2020) Towards understanding and prediction of atmospheric corrosion of an Fe/Cu corrosion sensor via machine learning. Corros Sci 170:108697 Chapter 5 Machine Learning in Asphaltenes Mitigation Ali Qasim and Bhajan Lal Abstract The issue of Asphaltenes formation inside the pipeline is a major concern in flow assurance industry. These are complex polar molecules with high molecular weights. Asphaltenes mitigation is required as they disrupt the normal operation of the pipeline. Industry employs mechanical, ultrasonic, thermal, bacterial and chemical treatments to mitigate asphaltenes deposition. For asphaltenes prediction, preceding studies have used thermodynamic solubility technique, colloidal based models. Currently researchers have focused on machine learning techniques to predict the conditions of asphaltenes formation. The machine and deep learning methods included Bayesian belief network (BBN), Least-squares support vector machine (LSSVM), Support vector regression (SVR) and Genetic algorithm-support vector regression (GA-SVR). It was found that the use machine learning and deep learning approaches predicted accurately about the onset of asphaltenes precipitation and deposition. In future, the utilisation of machine learning approaches in the field of asphaltenes mitigation can be studied further. Keywords Machine learning · Flow assurance · Asphaltene · AI 5.1 Introduction Asphaltenes are complex molecules with the largest molecular weight known in crude oils, are far more hazardous than typical wax deposition. These are essentially polar molecules [1, 2]. Figure 5.1 depicts a part of asphaltene that originates in the pipeline. In terms of chemical composition, asphaltenes are made up of heteroatoms such as carbon, nitrogen, hydrogen, sulphide, and oxygen. Aromatic structures (cyclic A. Qasim Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia B. Lal (B) Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia e-mail: bhajan.lal@utp.edu.my © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_5 81 82 A. Qasim and B. Lal Fig. 5.1 Asphaltenes formation inside pipeline in shape) are also produced. In a variety of solvents, asphaltenes have different solubility ratios. It is highly soluble in some solvents, such as benzene and toluene, but insoluble at room temperature in n-pentane and n-heptane. Asphaltene can form in heavy oil when temperature and pressure conditions, as well as the makeup of the oil’s phases, alter. The compounds in this chemical cause clogging inside oil pipelines and huge reservoir wells, making it dangerous. Because of its proclivity to associate and aggregate, asphaltenes have been termed the “Cholesterol of Petroleum”. They are a viscous substance that boils at a high temperature [3, 4]. Asphaltene content in oils can range from less than a percent to as much as 20% [5, 6]. A range of analytical methodologies have been used to characterise the structure and size of asphaltene aggregates. The structure of the asphaltene molecule, on the other hand, has remained a mystery. Structural characterization includes determining the chemical components, molecular weight and size, and molecule architecture. Heavy metals like Nickel and Vanadium have the potential to change the reactivity of asphaltene molecules [7]. 5.2 Asphaltene Precipitation and Deposition in Oil and Gas Industry The point at which asphaltenes begin to separate from oil is known as the commencement of asphaltene precipitation. One of the first stages in preventing asphaltene precipitation is to understand the asphaltenic fluid and its behaviour under various operating conditions from a thermodynamic aspect. Asphaltene precipitation occurs inside the asphaltene precipitation envelope (APE), which is defined by sufficient 5 Machine Learning in Asphaltenes Mitigation 83 temperature and pressure conditions [6, 8]. Figure 5.1 depicts a typical asphaltene phase envelope. APE can provide useful information on the way to adapt production settings to avoid asphaltene precipitation from reservoir fluid under high pressure and temperature. When reservoir pressure falls below the start of asphaltene precipitation pressure, which is lower than reservoir pressure but usually much higher than the saturation pressure of the active reservoir fluid, asphaltenes precipitate as shown in Fig. 5.2. As pressure decreases below the beginning precipitation pressure, the amount of asphaltene precipitation increases, reaching its maximum value as pressure approaches the bubble point pressure. As a result, the presence of gas components effects asphaltene precipitation, and the overall system’s composition and pressure control the stability of these precipitated particles. The operational pressure and temperature are represented by the P–T diagram. When modelling asphaltene precipitation with thermodynamic phase equilibrium, it is necessary to determine the energy associated with molecules as well as the parameters of interaction functional groups in the molecules [1, 9]. This emphasises the need of identifying and establishing the structure and properties of asphaltenes at the molecular level. Due to the improvements in research and the use of sophisticated analytical instruments, studying asphaltenes at the molecular level has resulted in the development of better thermodynamic prediction methods. Using equations of state, the structural analysis findings are applied to forecast the APE. Flow assurance engineers use this APE data to design production systems that maximise oil production while minimising asphaltene precipitation in reservoirs and flowlines [10]. However, precipitation is not the only factor that effects deposition; in order to form a layer, particles must contact the wall and adhere to it [11]. Asphaltene deposition is a serious flow assurance issue in oil and gas production, and resolving it takes a tremendous amount of capital. It is developed when the stability of asphaltene is affected by pressure, temperature, and composition of the involved system. The higher the asphaltene onset pressure, the lower the pressure at Fig. 5.2 Asphaltene precipitation envelope [6] 84 A. Qasim and B. Lal which asphaltene forms which is also known as Upper Asphaltenes Onset Pressure (UAOP) [12]. This phenomenon can exist near the wellbore as well as along the flow lines, expanding the potential deposition zone from the reservoir and near-wellbore regions to surface facilities. The lower asphaltene onset pressure is the pressure below the bubble point at which asphaltenes dissolve in a solution (LAOP). Asphaltene deposition is estimated the use of De Boer plot: This technique was suggested by De Boer et al. to assess when oil begins to form a solid phase, resulting in a reduction in flow rate. As revealed in Fig. 5.3, the De Boer plot shows the pressure differential between the starting pressure and the bubble point pressure against the initial density of the oil sample. There are three distinct zones depicted in this diagram: (1) Region A, which has a high risk of serious flow problems, (2) Region B, which faces moderate issues, and (3) Region C, which confronts minimal or minor flow issues [13]. When researching asphaltene flocculation and deposition in a pipe, the electro kinetic influence must be taken into account. This impact is caused by the electrical potential difference in the conduit caused by the movement of colloidal particles in the oil mixture, which promotes asphaltene deposition and clogging. Some of the parameters that have a considerable impact on this occurrence are the conduit’s characteristics include electrical, thermal, and wettability characteristics, pressure, temperature, flow regime, and oil mixture quality. Broseta et al. used a stainless-steel capillary to test the onset point and rate of asphaltene deposition when pressure, temperature, and composition were varied. This was accomplished by lowering the pressure across the capillary tube, which revealed the creation of a deposition layer. They also altered the standard light transmission mechanism to make it more receptive to fluids with a trace amount of asphaltene in them. Asphaltene deposition happened when the asphaltene was unstable under the process conditions. This procedure was also utilised to see if asphaltene deposition could be reversed [15]. Fig. 5.3 De Boer plot for Bubble Point [14] 5 Machine Learning in Asphaltenes Mitigation 85 Fig. 5.4 Cylindrical Taylor-Couette (TC) cell [14] Taylor-Couette (TC) cell is a high-pressure cell that can be used in real-world oil fields to manufacture organic deposition including asphaltenes and waxes [14]. The Taylor-Couette (TC) cell is depicted schematically in Fig. 5.4. The middle half of the cell is made up of a spinning spindle that can simulate pipe flow (Fig. 5.4, part b). The cell also has a cooling/heating bath that adjusts the temperature by circulating the coolant around cylinder. Akbarzadeh et al. [16] used the TC cell, but with a few modifications to reduce the cell’s shortcomings. To address the cell’s inability to function with a low level of asphaltene, they used the fresh sample of oil. The most critical component in the deposition rate was found to be the shear rate. There were also more deposits at the reservoir oil’s bubble point pressure. 5.3 Asphaltene Mitigation Procedures 5.3.1 Mechanical Method The mechanical method is to scrape the asphaltene sediment out of the wells mechanically. The most common approach is to use a wire line unit; however, this method is slow and expensive when dealing with a long and tough deposit. Another approach is to utilise a Coiled tubing device and a hydro-blasting equipment to drill the deposit. This device, however, has the disadvantage of limiting operating pressure, making cleaning more difficult. Another method of cleaning is to apply pressure to the deposit in order to create a differential pressure across it [17]. 86 A. Qasim and B. Lal 5.3.2 Ultrasonic Treatment Ultrasonic technology can be used to clean asphaltene-clogged portions of oil wells and reservoirs. Ultrasonic vibrations appear to disturb the maltenes that form a continuous phase to provide adhesive and ductile properties to the scattered asphaltenes [13]. Time, power, frequency, and the type of radiation necessary to remove asphaltene deposits all have an impact on the performance of ultrasonic waves. This method was tested on asphaltene clusters and permeability damage in carbonate porous media in reservoir rocks produced by asphaltene deposition. The use of ultrasonic radiation in that crude oil resulted in the disintegration of asphaltene clusters into fine sizes, as well as an improvement in reservoir rock permeability damage [18]. 5.3.3 Thermal Treatment There are a variety of thermal methods for treating asphaltene deposition, including hot oiling, which includes injecting a hot oil into the well to remove asphaltene deposits. This method, however, can be harmful to the formation [19]. A down hole heater can be used for a short amount of time to melt asphaltene deposits in the wellbore or on tubing, which can then be pumped up with the created oil. The application of this approach is limited, however, due to the high cost of maintenance and the shortage of electric power. The use of heat-liberating chemicals, which requires pumping down a solution of equimolar ammonium chloride and sodium nitrate, is another thermal approach for eliminating asphaltene deposits. Using a buffer, the exothermic reaction is postponed until the fluid reaches the bottom-hole with a significant amount of nitrogen gas. However, in comparison to the traditional thermal method, this technology is quite expensive [20]. 5.3.4 Bacterial Treatment In this treatment, bacteria are used to remediate asphaltene build-up. Almehaideb et al. [21] chose specialised bacteria with a high endurance for the extreme temperature and salinity conditions observed in the reservoir rock they studied in the lab. They exposed damaged cores to microorganisms in their experiment after they lost early oil permeability due to asphaltene accumulation. On average, bacterial stimulation resulted in a 54% improvement in defective core permeability. 5 Machine Learning in Asphaltenes Mitigation 87 5.3.5 Chemical Treatment Chemical treatment with solvents is required when mechanical treatments fail to remove asphaltene deposits. Asphaltene solvents are mostly made up of aromatic solvents. Alternatives to chemical solvents, such as de-asphaltened oils with high aromatics content were also used at low cost; xylene, with a low flash point of 28 °C. Toluene is much more volatile than benzene with a flashpoint of 5 °C, yet it is less effective. However, for a variety of reasons, including corrosion, safety concerns due to their low flash point, and environmental concerns, the use of these hydrocarbon solvents is restricted [5]. 5.4 Asphaltene Prediction Models The asphaltene prediction models include the models for the precipitation and deposition. They are based on thermodynamic solubility techniques, colloidal method and deposition modelling. The details of these models are discussed in the following sub-sections. 5.4.1 Thermodynamic Solubility Technique Thomas et al. [22] formulated a regular solution theory for multicomponent systems to characterise the asphaltene precipitation behaviours. They used Prausnitz’s GE = UE equation for a multicomponent solid phase, where GE is the excess Gibbs free energy accounting for the liquid system’s non-ideality and UE is the excess internal energy. To simulate asphaltene precipitation in Western Canadian bitumens, Alboudwarej et al. [23] employed a regular solution theory of the liquid–liquid equilibrium. They investigated the effects of several solvents on precipitation. As the system pressure was above the bubble point, a liquid–liquid equilibrium was hypothesised. They divided bitumens into four basic pseudo-components based on the Saturate, Aromatic, Resin and Asphaltene (SARA) fraction to overcome the categorization challenge of the regular solution theory: saturates, aromatics, resins, and asphaltenes. The distribution of molar mass, molar volume, and solubility characteristics of asphaltene was a major challenge when utilising regular solution theory to simulate asphaltene precipitation. The polydispersity of asphaltene, the difficulty of lumping asphaltenes as a single component, and determining the precise and reliable amount of precipitation were all compelling reasons to use the Schultz-Zimm molar mass distribution to partition asphaltene into variable molar mass fractions. The proposed method was successful in mimicking the commencement of asphaltene precipitation as well as the amount of asphaltene precipitation. At intermediate solvent/bitumen ratios, however, the model underpredicted simulation results. 88 A. Qasim and B. Lal Afterwards, Akbarzadeh et al. [24] updated the molar mass distribution function of the model employed by Thomas et al. with the gamma function and found the improved performance. According to the association model, asphaltene and resin both have active sites that allow them to bind to similar molecules and cause aggregation. Saturate and aromatic components are also considered neutral. Terminators and propagators are terms used to describe compounds that have one or more active sites. Finally, a combination of terminators and propagators make up asphaltene and resin. Thermal and hydrocracking processes modify the distribution function of molar weight, volume, and solubility, which are key characteristics in asphaltene precipitation, according to the researchers. The Flory–Huggins hypothesis was utilised by Hirschberg et al. [25] to model the amount of asphaltene precipitation. They employed Soave–Redlich–Kwong (SRK) equation of state (EoS) to simulate a vapour-liquid equilibrium thermodynamic condition. The liquid phase was made up of the solvent which was asphaltene-free and asphalt phases which contained asphaltene and resin. The Flory Huggins model had several discrepancies. First, there was an overestimation of asphaltene solubility in the presence of a large volume of solvent. Second, the model was unable to predict the amount of precipitation at pressures greater than 200 bar. Thirdly, asphaltene was thought to be homogenous. Rassamdana et al. [26] investigated the effects of nalkanes on a light oil sample using the Hirschberg model. They found a discrepancy between the model predictions and the experimental data. They argued that the difference originated from the concept of reversible precipitation events. A two-component Asphaltene Solubility Model (ASM) was later proposed based on the Flory–Huggins theory. Unlike previous implementations of the theory, the composition of the phases after asphaltene precipitation was not assumed, and the phases were defined by a link between refractive index and solubility properties. Despite its success in predicting the emergence of asphaltene, the ASM had a number of flaws discussed in literature [27, 28]. Changing the solubility parameter and molar volume, for example, required an optimization technique. Alternative solvents including pentane and pentadecane were also investigated using the same extent of solubility criteria. The Asphaltene Instability Trend (ASIST) was proposed based on the same premise, and the solubility parameters for numerous liquid solvents were plotted against the molar volume. In fact, ASIST found a linear relationship between the solubility parameter and the molar volume at the onset condition. Although some previous studies investigated the method’s usefulness for predicting asphaltene instability and the model was unable to effectively forecast the amount of precipitation [28, 29]. One of the simplest models in asphaltene precipitation is the cubic equation of state (EoS), which combines the solid phase fugacity correlation and the Peng-Robinson (PR) EoS. The asphaltene precipitated phase is assumed to be a pure solid in the model. The model is basic, but it is not exact enough, and it must be updated every time the components are altered [22]. To calculate the fugacity of components in a vapour-liquid equilibrium, Ngheim et al. [30] also used PR EoS. In their model, the heavy fraction of crude oil was divided into two categories: precipitating and non-precipitating. Dissociated asphaltene/resins made up the first percentage, while heavy paraffins and non-dissociable asphaltene/resins made up the latter. Although it 5 Machine Learning in Asphaltenes Mitigation 89 was dependent on the precise partitioning of the heavy fractions and their characteristics, the suggested model was successful in forecasting asphaltene phase separation. Furthermore, in the presence of a large number of solvents, the model failed to account for asphaltene precipitation. Other studies used PR EoS to investigate the asphaltene phase behaviour induced by n-alkanes, even designating thirty divisions to match the molar mass distribution of asphaltene. On the other hand, the effect of resins and aromatics on asphaltene stability has not been applied further [31, 32]. Based on Wertheim’s perturbation theory to the mixture, Chapman and associates developed Statistical Associating Fluid Theory, SAFT, a common model for modelling asphaltene phase behaviour. Perturbed Chain Statistical Associating Fluid Theory, PC-SAFT, appeared to be more suitable for simulating asphaltene behaviour than prior SAFT model variations [33]. Because the SAFT model’s effectiveness is heavily reliant on segment lumping and features, such as binary interaction factors, various methods of lumping in an oil mixture have been reported in the literature. Molecules are separated into a spherical chain of connected parts according to the SAFT theory. The number of segments per chain, segment diameter, and van der Waals energy of segments are all critical parameters that must be adjusted for saturated liquid densities and vapour pressures. These criteria are related to the molecular weight of a segment. PC-SAFT EoS was used by Gonzalez et al. [11] and Vargas et al. [34] to conduct substantial research on the modelling of asphaltene phase behaviour. They observed the effect of gas injection on the onset of asphaltene precipitation as well as the pressure at which bubbles form. They looked at how gas injections of methane, ethane, CO2 , and N2 affected the formation of asphaltene. To account for the polydispersity of asphaltene, it was split into three to nine subtractions and the SAFT parameters were modified [34]. Asphaltene precipitation was exaggerated in the proposed model since it took into consideration the polydispersity effect. Later, Alhammadi et al. [36] compared the PC-SAFT with the CPA, which contained the Peneloux shift parameter in its physical element, in terms of prediction performance. Although the Peneloux shift parameter was included to the cubic EoSs (SRK, PR, and the physical half of CPA), the PC-SAFT fared better in thermodynamic property modelling at equilibrium. To model the onset of asphaltene precipitation and bubble point pressure with and without gas injection, Arya et al. used PCSAFT EoS with the association contribution. They compared PC-SAFT with the association (WA) to PC-SAFT EoS without the association (WOA) and CPA EoS outcomes. They used the models to examine six reservoir fluids and found encouraging results, allowing the commencement of asphaltene precipitation to be adequately modelled. However, for two of the fluid samples, the PC-SAFT (WOA) was unable to correlate the higher onset pressure [35] as shown in Fig. 5.5. 90 A. Qasim and B. Lal Fig. 5.5 Correlation and prediction of Upper Asphaltene Onset (UOP) and Bubble Point (BP) pressures, a without gas injection or GI, b with 5 mol% gas injection, c with 10 mol% gas injection, and d with 15 mol% gas injection [35] 5.4.2 Colloidal Technique Li and Firoozabadi [37] used PR EoS within the CPA framework to model the asphaltene phase behaviour. A physical component based on PR EoS and an association component based on Wertheim’s thermodynamic perturbation theory made up the CPA model. Oil was considered to include three spurious components: saturate, aromatic/resin, and asphaltene. The single variable in the model is the association energy parameter. Furthermore, the model succeeded of modelling precipitation incidence but not so much of forecasting the onset point. This problem can be traced back to a change in the association energy parameter. Shirani et al. [38] used a similar paradigm to study a real oil sample with fifteen pseudo-components, ignoring the 5 Machine Learning in Asphaltenes Mitigation 91 interaction of asphaltene with other components and focusing only on self-association of asphaltene particles. For the physical portion of the model, they looked at both SRK and PR EoSs and discovered that SRK EoS performed better than PR EoS and colloidal models. According to CPA research for modelling asphaltene phase behaviour, the chemical interaction of monomers leads to association due to the increase of new species. Some temperature-dependent variables were assumed to be constant, which is a flaw in the method [37]. The first instance colloidal theory was applied to asphaltene precipitation was by Pfeiffer and Saal [39]. It was claimed that lighter hydrocarbons in the oil combination peptize asphaltene, and a lack of resins to cover the asphaltene heavy particles caused asphaltene precipitation. Asphaltene aggregation and precipitation are caused by the transfer of peptizing agent which is a resin from the asphaltene phase to the oil phase and vice versa. The outer layer stabilises the asphaltene due to steric repulsion. As a result, adding a solvent (n-alkane) causes peptizing agents in the outer layer to transition to the oil phase, increasing the polarity of the asphaltene phase while decreasing the polarity of the oil phase, increasing the polarity of the asphaltene phase while decreasing the polarity of the oil phase. The polarity of the asphaltene phase reaches a point where the asphaltene micelles become linked and grow in size at first. One of the earliest applications of the colloidal approach to model asphaltene precipitation was by Leontaritis and Mansoori [40]. The particles of asphaltene were seen as a solid phase surrounded by resins. When an n-alkane solvent was applied to the oil, asphaltene precipitated. The precipitation condition was modelled using a Vapour-Liquid Equilibrium (VLE) calculation method. The critical resin concentration was changed based on the experimental findings. The model, however, is only valid when asphaltene precipitation is reversible i.e. asphaltene dissociation occurs. Other researchers [41, 42] used the colloidal structure and tweaked it slightly. For example, Pan and Firoozabadi [42] investigated two phases: a precipitated phase (asphaltene and resin) and a liquid phase. The thermodynamic parameters of the species were calculated using EoS, and phase compositions were determined by minimising the Gibbs free energy. The model has several problems, including the requirement for a large number of parameters and the absence of a clear relationship between the parameters and thermodynamic conditions such as pressure, temperature, and composition. 5.4.3 Asphaltene Deposition Modelling Asphaltene precipitation at a certain pressure and temperature facilitates flow assurance induced problems formation in the reservoir. When the solid phase evolves in the porous structure, the permeability of the rocks diminishes, lowering inflow performance. The models in the literature, as shown in Fig. 5.6, tend to assume the following 92 A. Qasim and B. Lal Fig. 5.6 Asphaltene-deposition-induced rock impairment mechanisms [6] mechanisms: (1) adsorption of asphaltene nano-aggregates in the reservoir’s capillary pores, forming a deposited layer that partially restricts flow, (2) clogging of pore throats by larger aggregates caused by particle deposition, and (3) shear removal of asphaltene particles, increasing the permeability of the rock. The flow impairment caused by asphaltene-induced formation damage was detected by researchers using several advanced mathematical models that accounted for the diffusivity of distinct phases in porous environments. The suspension of asphaltene nano-aggregates in liquid is considered in most of these models (oil phase). Gruesbeck and Collins [43] were the first to model the deposition of fines, up to 5 m, in porous media, indicating major changes in the permeability of the formation rock and accounting for the reduction in productivity. The diffusivity model was constructed by Wang and Civan [44], who used an empirical correlation to account for the deposition of asphaltene. The liquid influx terms were computed using the Darcy law, whereas the adsorption and clogging mechanisms in the deposition were described using empirical components. The overall mass balance of the asphaltene phase is represented by Eq. 5.1, and the correlation utilised to calculate deposition via adsorption, deposition removal as a result of drag force, and pore clogging is represented by Eq. 5.2. ρa ∂wa L ∂ (ϕρa Cnp + ϕρ L wa L μ f ) = ρa ∂t ∂t (5.1) ∂wa L = αϕCnp − βwa L (μ L − μ L ,crit ) + ς Cnp μ f ∂t (5.2) where ϕ is the porosity, ρ a is the density of asphaltene, C np is the concentration of nanoparticles, ρ L is the density of the liquid phase, waL is the mass fraction of dissolved asphaltene in the liquid phase, uf is the mean fluid velocity represented by the Darcy law, uL is the interstitial velocity of the liquid phase, uL,crit is the critical 5 Machine Learning in Asphaltenes Mitigation 93 interstitial velocity of the liquid phase, α is the empirical constant for deposition, β is empirical constant indicating removal of the deposit, and ζ is the empirical constant accounting for plug clogging. The constants were not dependent on particle size and obtained experimentally by core flooding. For the four phases of gas, oil, water, and asphaltene, Preceding researches undertook comprehensive reservoir simulations in cylindrical coordinates, accounting for reservoir damage induced by asphaltene deposition [45, 46]. The black oil model was used to estimate the fluid’s properties. Soulgani et al. [47] proposed a new adsorption model based on the Arrhenius kinetic equation that avoided Brownian particle diffusion along the pores’ walls. The rate of deposition and the mean velocity of fluids through the pores was found to be inversely dependent. Kord et al. [48] revised the plugging and adsorption terms in the Wang and Civan model using Arrhenius rate equations. The model outperformed the previous models when compared to flow loop studies. Behbahani et al. [49] coupled the asphaltene precipitation from equilibrium thermodynamics and the convection diffusion equations with Wang and Civan’s rock impairment model to study multilayer adsorption of asphaltene in the pores. The deposition process, on the other hand, was limited by thermodynamic restrictions, resulting in a minor contribution to the overall mass balance. Ramirez et al. [50], proposed one of the earliest asphaltene deposition model in flowlines. They stated molecular diffusion as the primary process for asphaltenes to accumulate on pipe walls. Similar to wax deposition, the asphaltene molecules moved toward the pipe walls as a result of the thermal difference between the bulk fluid temperature and the pipe walls. According to the model, the molecules diffused in the dissolved state and precipitated on the pipe wall, which is at a lower temperature than the bulk fluid. Near the wall, however, oil components diffuse into the main stream, causing asphaltene and oil molecules to diffuse in the reverse way. In addition to the mechanism, shear forces were expected to remove a portion of the deposit in the model. Mirzayi et al. [51] investigated at other mechanisms such gravity settling, thermophoresis, buoyancy, Brownian diffusion, drag force, and shear removal. Particle movement in both laminar and turbulent flows can be studied using these forces. Shirdel et al. [52] evaluated the deposition rate of asphaltene particles using typical particulate deposition principles in various flow regimes. Friedlander and Johnstone98 presented classical models of particle flow in turbulent conditions with eddy diffusion, which were compiled in this study. In addition, as recommended by Cleaver and Yates [53], a stochastic approach to determining the deposition was used. As seen in Eq. 5.3, the flow regime was determined on the basis of particle relaxation time. The model performances were compared to experimental data from the literature on iron particles, air flow, and oil-asphaltene flow, 29 and it was concluded that the models proposed by previous researchers were consistent with experimental data and could be used for asphaltene deposition as well. The Beal model was found to be the best among all. 94 A. Qasim and B. Lal τ p+ = ρ p d 2p 18μ f f .2 2 u avg γ (5.3) Guan et al. [4] developed a one-dimensional transient model to account for crosssectional variance in asphaltene deposition along pipelines and predict deposition above the bubble point temperature. The EoS model was used to calculate the asphaltene equilibrium concentration i.e. solubility of asphaltene at a particular temperature and pressure while numerically solving the heat, mass, and momentum transport equations. The precipitation and aggregation mechanisms were assumed to be first-order kinetics while solving the concentration profile. 5.5 Machine Learning Application in Asphaltenes Precipitation and Deposition Control The effect of several variables and parameters on asphaltene precipitation was investigated using a Bayesian belief network (BBN) as an artificial intelligence modelling method. The parameters included pressure, diluents used and dilution ratio. The BBN model’s projected findings were compared to experimental precipitation data taken in a high-pressure cell and analysed using image analysis tools. The cell accessories make in-situ visual monitoring of asphaltene centres growth at high pressures and temperatures possible. The relative absolute discrepancy between model predictions and experimental data was found to be less than 4.6% on average. Under varied conditions, the established BBN model was also able to anticipate the start of asphaltene precipitation or the burst of nucleation. According to a comparison of their predictions, the BBN model anticipates asphaltene precipitation more accurately and covers a wider range of affected variables/parameters than the alternatives [54]. Figure 5.7 shows the structure of BBN model for asphaltene precipitation. Sarapardeh et al. [55] offered a reliable and predictive model for predicting asphaltene precipitation, particularly the least-squares support vector machine (LSSVM). This model was created and evaluated using 157 separate sets of experimental data for Fig. 5.7 Structure of the developed BBN for asphaltene precipitation [54] 5 Machine Learning in Asphaltenes Mitigation 95 32 different crude oils from a variety of Iranian oil reserves. Because the data ranges utilised to construct the model encompass many of Iran’s PVT data, the resulting model might be trusted to anticipate samples from additional Iranian oil reservoirs. The model’s adequacy and accuracy were determined by statistical and graphical error analysis. The findings showed that the developed model was capable of making accurate predictions based on experimental data. Furthermore, the suggested method accomplished of reproducing the real physical trend of asphaltene precipitation as a function of pressure variation. Finally, utilising the statistical Hat matrix, Williams plot, and residuals of the model results, the Leverage technique was applied to identify the likely outliers. All the experimental data, except for five instances, appeared to be reliable. As a result, given its applicability range, it was concluded that the developed model could be useful in forecasting asphaltene precipitation. This model may be used in any reservoir simulator software and provides adequate accuracy and performance when compared to existing techniques. Rostami et al. [56] employed Gaussian Process (GP) regression models to anticipate asphaltene precipitation in tank and live crude oils. To begin, feature selection was utilised to discover which parts of the training data set were most relevant for predicting asphaltene precipitation. Consequently, six feature sets were generated, each of which was utilised to develop a Gaussian process model for predicting asphaltene precipitation. The results of the models developed in this study were then compared to those of previously published publications. According to the results, their models outperformed the preceding studies from the literature. Na’imi et al. [57] used Support vector regression, a unique computer learning approach, was used to estimate the amount of asphaltene precipitation using experimental titration data. The results of the support vector regression model were compared to those of the artificial neural network and the scaling equation. The results indicated satisfactory agreement with experimental data and accurate prediction when compared to artificial neural networks and scaling equations. Sarapardeh et al. [58] predicted the amount of asphaltene precipitation during titration testing as a function of easily measured parameters such as temperature, solvent type, and solvent to oil dilution ratio. Asphaltene precipitation data was obtained from a variety of sources, and it covered a wide range of thermodynamic conditions and crude oil types. A least square support vector machine (LSSVM) was utilised for modelling, and it was modified using a stochastic process known as couples simulated annealing (CSA). The data bank was divided into four groups based on the kind of solvent and the solvent to oil dilution ratio. Then, for each area, a model was proposed, and the results showed that all of the proposed models can accurately calculate the amount of asphaltene precipitation. In summary, the proposed CSA-LSSVM models predicted asphaltene precipitation with an average absolute relative error of 9.46%. The suggested CSA-LSSVM models beat previously published models in both graphical and statistical assessments. Finally, a mathematical model was used to identify not only the suggested models’ application area, but also the quality of the experimental data and the presence of possible outliers. Only 3.3% of the data indicated possible outliers, indicating that all of the proposed models are statistically valid. 96 A. Qasim and B. Lal Ghorbani et al. [59] used a machine learning technique to predict asphaltene precipitation under various conditions. The genetic algorithm-support vector regression (GA-SVR) was employed in this research as a new model for predicting the amount of asphaltene precipitation. To improve the SVR’s generalisation performance, GA was utilised to find the best optimal values of SVR parameters and kernel parameter at the same time. On the experimental data sets published in the literature, the GA-SVR model was trained and tested. Statistical error measurements and graphical analysis were used to compare the GASVR model’s performance against that of two scaling equation models. The findings revealed that the suggested model’s prediction performance was very dependable. Wang et al. [60] used coarse-grained molecular dynamics simulations for an archetypal asphaltene molecule. The phase diagram that mapped self-assembled morphologies as a function of temperature, pressure, and the n-heptane-toluene solvent ratio was developed. It was suggested that this information could be utilised to manage asphaltene aggregation by changing the external processing conditions. The low-dimensional free energy surfaces governing asphaltene self-assembly were discovered using simulations, graph matching, and nonlinear manifold learning. Researchers proposed the first use of many-body diffusion maps to reconstruct a pseudo-1D free energy landscape for molecular self-assembly, as well as a diffusion map version that was better suited to data sets with high local density changes. Increasing pressure had a minor impact on the terrain, destabilising the larger aggregates. Small cluster sizes and loose bonding configurations were stabilised by increasing temperature and toluene solvent fraction. The effects of these two were remarkably similar, even though the underlying molecular mechanisms were different. Ristanto [61] used historical bottom hole pressure and flow rate data to develop a reservoir model using machine learning methodologies without explicitly programming the mechanics of the flow. It was influenced by studying the past pattern of bottom hole pressure and flow rate or training set. Flow rate could be forecasted depending on bottom hole pressure using the adopted model. This model could also be used to aid in the diagnosing process. The actual pressure and flow rate response differed from what the model predicted if liquid loading, condensate banking, or wax/asphaltene deposition begin, indicating that the reservoir performance had changed. Previous studies applied machine learning approaches to single-phase cases and framed the problem as a linear problem with the nonlinearity highlighted in the characteristics, but this study employed machine learning and deep learning to solve multi-well and multiphase problems. The research revealed key characteristics of such situations as this study looked at the performance of ten different machine and deep learning algorithms. Python was found to be good for this since it had a wide variety of machine/deep learning libraries to choose from and is better suited to machine learning problems. Multiphase flow, reservoir heterogeneity, and data noise were all considered. Elkhatib et al. [62] designed the experiments by flowing asphaltene-in-toluene solutions through capillary polyetheretherketone tubes and measured their crosssectional areas with high-resolution scanning electron microscopy. Denoising, which 5 Machine Learning in Asphaltenes Mitigation 97 is an analysing local and global bias and variance and binarization using machinelearning techniques were utilised in a two-step digital image analysis to improve picture segmentation quality. Polydispersity divided particles on the tube surface into nanoaggregates (1.54 nm), small clusters (SCs, 410 nm), medium clusters (MCs, 1020 nm), large clusters (LCs, 20,100 nm), and extra-large clusters (XLCs, > 100 nm). A Langmuir adsorption isotherm was determined in toluene, with an adsorption free energy of 29 kJ/mol, which corresponded with previous observations. Nanoaggregates and SCs were the predominant elements of the adsorption layer due to their high mass diffusivity. As the concentration of asphaltene in toluene increased, a conflict between aggregation and adsorption was observed. Due to better self-assembly in the bulk phase, the number of adsorbed particles had been progressively decreasing. Adding n-heptane to toluene at various volume ratios induced the deposition of MCs, with a peak in particle size, number, and mass density around the start of precipitation. These clusters were possible fouling precursors because they act as building blocks of larger particles that amass on the surface over time. Limiting their deposition could be accomplished by increasing the flow rate or introducing chemical inhibitors that favour the formation of larger aggregates in the bulk phase under specific flow conditions. The findings of this study demonstrated that MC-rich petroleum fluids are more susceptible to flow assurance issues, and that effective flow enhancers enhance the aggregation of MCs into particles that are too large to deposit. Gesho et al. [62] developed a fully automated image processing and analysis method using data analytics, pattern recognition, and machine learning including deep learning techniques to automate image processing and investigate physical properties and nanoscale deposition of petroleum constituents, asphaltenes, on surfaces from hundreds of images. In order to accomplish this, many data preparation procedures such as picture filtering and quality assessment methodologies were originally devised. The retrieved information was then used to identify and quantify required physical attributes and deposition parameters using denosing and picture segmentation techniques. By comparing the model to experimental results from asphaltene deposition studies, they were able to validate the proposed technique. The model’s output was then compared against experimental data published in the literature. This application revealed the mechanism of asphaltene deposition, allowing for a better understanding of the process. The construction of fully automated image-processing model that characterises physical properties of deposited species is novel. Using a combination of data and descriptive models, researchers were also able to differentiate foreground and background information particles from SEM images, indicating that the model might be used in future image processing applications. The workflow, executed processes, and applied methods are shown in the four columns in Fig. 5.8. Ali et al. [63] employed machine learning methods to develop a realistic predictive model for asphaltene adsorption on MgO nanoparticles. Three machine learning (ML) methods were used to create the models: gradient boosting machine (GBM), bagging (BG), and random forest (RF). The models were created utilising 36 data points, four of which were nanoparticle surface area, nanoparticle dosage, experimental temperature, and asphaltene equilibrium concentration in the supernatant toluene. Correlation analysis was carried out using a heat map. When the surface area 98 A. Qasim and B. Lal Fig. 5.8 Diagram of the Image Processing and Analysis Model. Yellow, Green, and Orange refer to deep learning, machine learning, and statistical analysis, respectively [62] of the nanoparticles was increased, the adsorption of asphaltene on MgO nanoparticles is greatly enhanced, but when the nanoparticle dose was increased, the adsorption of asphaltene on MgO nanoparticles lowered significantly. Temperature and equilibrium concentration have no effect on the adsorption phenomenon. A new experimental dataset during the development process was used to validate the models. 5.5.1 Case Study The case study involves the data analysis from over 100 wells impacted by asphaltenes of onshore fields in Abu Dhabi by Abu Dhabi National Oil Company [64]. In order to detect the asphaltene problem earlier, an asphaltene-specific realtime sensor is required as clean-up operations and reactive maintenance rely on accessibility inspection and may affect the normal operation of the pipeline. In this study, the chosen sensor design was based on the concept of Electron Paramagnetic Resonance (EPR), in which free-radicals in asphaltene resonate with an external magnetic field. The EPR signal is proportional to the amount of asphaltene in the crude, with a signal reduction indicating probable deposition upstream of the sensor. From conception through commercialization, the study was based on the research collaboration between a national oil firm, a university, and a start-up technology supplier. The outcome is a first-of-its-kind industrial Internet of Things (IoT) realtime monitoring device that can detect asphaltene deposition and optimise chemical 5 Machine Learning in Asphaltenes Mitigation 99 programmes by combining surface data into an integrated flow assurance management system. By focusing on the asphaltene free-radical reaction rather than looking for a broad spectrum of chemicals, it was possible to miniaturise and ruggedize a device for oilfield applications. It was still required to show that the adjustment had not resulted in a reduction in resolution. Instead of having the device installed directly into one well for the first field trial in these onshore fields, the system was tested offline so that daily analysis from 15 distinct wells could be done and device resolution could be tested. The resolution was found to be superior than 0.1%. Furthermore, some wells showed nearly 5% variance from one day to the next, while others only showed 1% variation. The wells with the highest standard deviation have previously experienced greater asphaltene issues. The results from these 15 wells exceeded expectations, therefore a second field trial was launched, this time with the device mounted inline at the wellhead for real-time continuous monitoring. The use of this method is expected to aid in the planning of clean-up operations before a well is completely sealed. This should result in significant cost savings as well as reduced well downtime and output loss. A sensor was developed to notice the unusual response signature to asphaltene. Whether the asphaltene is in solution or not, peak-to-peak voltage, Vpp , is proportional to the amount of asphaltene in the crude, according to the laboratory experiments. The signal width, defined as the horizontal distance between two peaks, could be calculated using automated field matching of this theoretical curve, providing a reliable method of peak-to-peak voltage analysis. Although two crude samples in Figs. 5.9 and 5.10 show a correlation with particle size, only preliminary testing has been done to assess the efficiency of this computation. The first sample has a peak-to-peak voltage of 2518 mV (about 9.5% asphaltene) and a width of 0.85 (in normalized units), while the second has a peak-to-peak voltage of 1563 mV (roughly 5.6% asphaltene) and a width of 1.01. Because this is based on laboratory data, one of the pilot phase’s unknowns will be if we can detect spectral breadth variations and whether they can be linked to field activity or distinct reservoir zones. Significant ruggedization of the sensor was performed to prepare it for the onshore use in Abu Dhabi. The cloud-based approach was used and reviewed by researchers Fig. 5.9 High-resolution microscope analysis of small asphaltene particles suspended in the oil (and some water droplets) and a narrow EPR spectral curve [64] 100 A. Qasim and B. Lal Fig. 5.10 High-resolution microscope analysis of large asphaltene particles suspended in the oil and a broader spectral EPR curve [64] in MicroSilicon Head Quarter. Cloud systems enabled data access for each hour with guaranteed backup and storage. It was further proposed that data validation should be done by the operator by conducting frequent well testing, gauge cutter runs and asphaltene content measurement through SARA analysis to corroborate the readings from the sensor. The industrial IoT real-time monitoring device is novel in flow assurance industry. 5.6 Conclusion Asphaltenes are complex molecules with the largest molecular weight known in crude oils, are far more hazardous than typical wax deposition. These are essentially polar molecules. In terms of chemical composition, asphaltenes are made up of heteroatoms such as carbon, nitrogen, hydrogen, sulphide, and oxygen. The point at which asphaltenes begin to separate from oil is known as the commencement of asphaltene precipitation which eventually results in their deposition. Once asphaltenes deposit inside the surface of the pipeline they cause hindrance to normal flow operation. Mechanical, ultrasonic, thermal, bacterial and chemical treatments are the main techniques used by flow assurance industry to mitigate asphaltenes deposition. Various asphaltenes prediction models have been reported in the literature to predict the onset of asphaltenes precipitation and deposition. In this regard, thermodynamic solubility technique, colloidal based models and asphaltene deposition modelling have been developed and discussed by the preceding researches. Currently researchers are focussing on machine learning techniques to predict the onset of asphaltenes precipitation and deposition at laboratory and industrial scale. The machine and deep learning methods included Bayesian belief network (BBN), Least-squares support vector machine (LSSVM), Support vector regression and Genetic algorithm-support vector regression (GA-SVR). It was concluded that the machine learning and deep learning methods were useful in predicting the temperature and pressure conditions of asphaltenes precipitation onset as the predictions 5 Machine Learning in Asphaltenes Mitigation 101 were accurate. In future the use of machine learning techniques can be advanced further with high accuracy in the field of asphaltenes mitigation. References 1. Ghamartale A, Afzali S, Rezaei N, Zendehboudi S (2021) Asphaltene deposition control by chemical inhibitors : theoretical and practical prospects. Gulf Publishing Company, Austin 2. Lal B, Qasim A, Mohammad Sharif A (2021) Application of ionic liquids in wax, scale and Asphaltene deposition control. In: Ionic Liquids in Flow Assurance. Springer, Cham, pp 49–63 3. Kokal SL, Sayegh SG (1995) Asphaltenes: the cholesterol of petroleum. In: Proceedings of middle east oil show, vol 1, pp 169–181 4. Guan Q, Goharzadeh A, Chai JC, Vargas FM, Biswal SL, Chapman WG, Zhang M, Yap YF (2018) An integrated model for asphaltene deposition in wellbores/pipelines above bubble pressures. J Pet Sci Eng 169:353–373 5. Theyab MA (2018) Fluid flow assurance issues: literature review. Sci Fed J Pet 2:1–11 6. Al-Hosani A, Ravichandran S, Daraboina N (2021) Review of asphaltene deposition modeling in oil and gas production. Energy Fuels 35:965–986 7. Fan HF, Li ZB, Liang T (2007) Experimental study on using ionic liquids to upgrade heavy oil. Ranliao Huaxue Xuebao. J Fuel Chem Technol 35:32–35 8. Speight JG (1998) Asphaltenes and the structure of petroleum. Oil Gas Sci Technol 59:467–477 9. Ogunlaja AS, Hosten E, Tshentu ZR (2014) Dispersion of asphaltenes in petroleum with ionic liquids: evaluation of molecular interactions in the binary mixture. Ind Eng Chem Res 53:18390–18401 10. Bera A, Agarwal J, Shah M, Shah S, Vij RK (2020) Recent advances in ionic liquids as alternative to surfactants/chemicals for application in upstream oil industry. J Ind Eng Chem 82:17–30 11. Buenrostro-Gonzalez E, Lira-Galeana C, Gil-Villegas A, Wu J (2004) Asphaltene precipitation in crude oils: theory and experiments. AIChE J 50:2552–2570 12. Abutaqiya MIL, Sisco CJ, Wang J, Vargas FM (2019) Systematic investigation of asphaltene deposition in the wellbore and near-wellbore region of a deepwater oil reservoir under gas injection. Part 1: thermodynamic modeling of the phase behavior of polydisperse asphaltenes. Energy Fuels 33:3632–3644 13. de Boer RB, Leerlooyer K, Eigner MRP, van Bergen ARD (1995) Screening of crude oils for asphalt precipitation: theory, practice, and the selection of inhibitors. SPE Prod Facil 10:55–61 14. Alimohammadi S, Zendehboudi S, James L (2019) A comprehensive review of asphaltene deposition in petroleum reservoirs: theory, challenges, and tips. Fuel 252:753–791 15. Broseta D, Robin M, Savvidis T, Fejean C, Durandeau M, Zhou H (2000) Detection of Asphaltene deposition by capillary flow measurements. https://doi.org/10.2118/59294-ms 16. Akbarzadeh K, Eskin D, Ratulowski J, Taylor S (2011) Asphaltene deposition measurement and modeling for flow assurance of subsea tubings and pipelines. Proc Annu Offshore Technol Conf 1:256–264 17. Gharbi K, Benyounes K, Khodja M (2017) Removal and prevention of asphaltene deposition during oil production: a literature review. J Pet Sci Eng 158:351–360 18. Taheri-Shakib J, Shekarifard A, Naderi H (2018) Analysis of the asphaltene properties of heavy crude oil under ultrasonic and microwave irradiation. J Anal Appl Pyrolysis 129:171–180 19. Turosung SN, Ghosh B (2017) Application of ionic liquids in the upstream oil industry-a review. Int J Petrochem Res 1:50–60 20. Zekri AY, Shedid SA, Alkashef H (2003) User of laser technology for the treatment of asphaltene deposition in carbonate formations. Pet Sci Technol 21:1409–1426 21. Almehaideb RA, Zekri AY, Arab U (2001) Possible use of bacteria-steam to treat asphaltene deposition in carbonate rocks. In: SPE Europen form damage conference 102 A. Qasim and B. Lal 22. Thomas FB, Bennion DWDB, Bennion DWDB, Hunter BE (1992) Experimental and theoretical studies of solids precipitation from reservoir fluid. J Can Pet Technol. https://doi.org/10. 2118/92-01-02 23. Alboudwarej H, Akbarzadeh K, Beck J, Svrcek WY, Yarranton HW (2003) Regular solution model for asphaltene precipitation from bitumens and solvents. AIChE J 49:2948–2956 24. Akbarzadeh K, Alboudwarej H, Svrcek WY, Yarranton HW (2005) A generalized regular solution model for asphaltene precipitation from n-alkane diluted heavy oils and bitumens. Fluid Phase Equilib 232:159–170 25. Hirschberg A, deJong LNJ, Schipper BA, Meijer JG (1984) Influence of temperature and pressure on asphaltene flocculation. Soc Pet Eng J 24:283–293 26. Rassamdana H, Dabir B, Nematy M, Farhani M, Sahimi M (1996) Asphalt flocculation and deposition: I. The Onset of precipitation. AIChE J 42:10–22 27. Creek JL, Wang J, Buckley JS (2009) Verification of asphaltene-Instability-trend (asist) predictions for low-molecular-weight alkanes. SPE Prod Oper 24:360–367 28. Wang JX, Buckley JS (2001) An experimental approach to prediction of asphaltene flocculation. In: Proceeding of SPE international symposium oilfield chemistry, pp 179–187 29. Buckley JS, Wang J, Creek JL (2007) Solubility of the least-soluble asphaltenes. Asph Heavy Oils, Pet 401–437 30. Nghiem LX, Coombe DA (1997) Modeling asphaltene precipitation during primary depletion. SPE J 2:170–176 31. Vafaie-Sefti M, Mousavi-Dehghani SA, Mohammad-Zadeh M (2003) A simple model for asphaltene deposition in petroleum mixtures. Fluid Phase Equilib 206:1–11 32. Sabbagh O, Akbarzadeh K, Badamchi-Zadeh A, Svrcek WY, Yarranton HW (2006) Applying the PR-EoS to asphaltene precipitation from n-alkane diluted heavy oils and bitumens. Energy Fuels 20:625–634 33. Chapman WG, Keith Gubbins TJJE, Jackson G, Radosd M (1990) Emulsion polymerization in continuous reactors. In: Emulsion polymerization; Piirma, I. Science and technology of polymer colloids, vol 29, pp 51–59 34. Vargas FM, Gonzalez DL, Hirasaki GJ, Chapman WG (2009) Modeling asphaltene phase behavior in crude oil systems using the perturbed chain form of the statistical associating fluid theory (PC-SAFT) equation of state. Energy Fuels 23:1140–1146 35. Arya A, Liang X, Von Solms N, Kontogeorgis GM (2016) Modeling of asphaltene onset precipitation conditions with cubic plus association (CPA) and perturbed chain statistical associating fluid theory (PC-SAFT) equations of state. Energy Fuels 30:6835–6852 36. Alhammadi AA, Vargas FM, Chapman WG (2015) Comparison of cubic-plus-association and perturbed-chain statistical associating fluid theory methods for modeling asphaltene phase behavior and pressure-volume-temperature properties. Energy Fuels 29:2864–2875 37. Li Z, Firoozabadi A (2010) Modeling asphaltene precipitation by n-alkanes from heavy oils and bitumens using cubic-plus-association equation of state. Energy Fuels 24:1106–1113 38. Shirani B, Nikazar M, Naseri A, Mousavi-Dehghani SA (2012) Modeling of asphaltene precipitation utilizing association equation of state. Fuel 93:59–66 39. Pfeiffer JP, Saal RNJ (1940) Asphaltic bitumen as colloid system. J Phys Chem 44:139–149 40. Leontaritis KJ, Mansoori GA (1987) Asphaltene flocculation during oil production and processing: a thermodynamic colloidal model. Soc Pet Eng AIME, SPE 149–158 41. Victorov AI, Firoozabadi A (1996) Thermodynamic micellization model of asphaltene precipitation from petroleum fluids. AIChE J 42:1753–1764 42. Pan H, Firoozabadi A (2000) Thermodynamic micellization model for asphaltene precipitation inhibition. AIChE J 46:416–426 43. Gruesbeck C, Collins RE (1982) Entrainment and deposition of fine particles in porous media. Soc Pet Eng J 22:847–856 44. Wang S, Civan F (2001) Productivity decline of vertical and horizontal wells by asphaltene deposition in petroleum reservoirs. In: Proceedings of SPE international symposium oilfield chemistry, pp 145–160 5 Machine Learning in Asphaltenes Mitigation 103 45. Almehaideb RA (2004) Asphaltene precipitation and deposition in the near wellbore region: a modeling approach. J Pet Sci Eng 42:157–170 46. Solaimany-Nazar AR, Zonnouri A (2011) Modeling of asphaltene deposition in oil reservoirs during primary oil recovery. J Pet Sci Eng 75:251–259 47. Soulgani BS, Tohidi B, Jamialahmadi M, Rashtchian D (2011) Modeling formation damage due to asphaltene deposition in the porous media. Energy Fuels 25:753–761 48. Kord S, Mohammadzadeh O, Miri R, Soulgani BS (2014) Further investigation into the mechanisms of asphaltene deposition and permeability impairment in porous media using a modified analytical model. Fuel 117:259–268 49. Jafari Behbahani T, Ghotbi C, Taghikhani V, Shahrabadi A (2015) Étude Expérimentale Et Modélisation Mathématique Du Mécanisme De Déposition D’Asphaltène Dans Des Carottes De Forage. Oil Gas Sci Technol 70:1051–1074 50. Ramirez-Jaramillo E, Lira-Galeana C, Manero O (2006) Modeling asphaltene deposition in production pipelines. Energy Fuels 20:1184–1196 51. Mirzayi B, Mousavi Dehghani SA, Chakan MB (2013) Modeling of asphaltene deposition in pipelines. J Pet Sci Technol 3:15–23 52. Shirdel M, Paes D, Ribeiro P, Sepehrnoori K (2012) Evaluation and comparison of different models for asphaltene particle deposition in flow streams. J Pet Sci Eng 84–85:57–71 53. Cleaver JW, Yates B (1975) A sub layer model for the deposition of particles from a turbulent flow. Chem Eng Sci 30:983–992 54. Sayyad Amin J, Alamdari A, Mehranbod N, Ayatollahi S, Nikooee E (2010) Prediction of asphaltene precipitation: learning from data at different conditions. Energy Fuels 24:4046–4053 55. Hemmati-Sarapardeh A, Alipour-Yeganeh-Marand R, Naseri A, Safiabadi A, Gharagheizi F, Ilani-Kashkouli P, Mohammadi AH (2013) Asphaltene precipitation due to natural depletion of reservoir: determination using a SARA fraction based intelligent model. Fluid Phase Equilib 354:177–184 56. Rostami H, Khaksar Manshad A (2013) Prediction of asphaltene precipitation in live and tank crude oil using Gaussian process regression. Pet Sci Technol 31:913–922 57. Na’imi SR, Gholami A, Asoodeh M (2014) Prediction of crude oil asphaltene precipitation using support vector regression. J Dispers Sci Technol 35:518–523 58. Hemmati-Sarapardeh A, Ameli F, Dabir B, Ahmadi M, Mohammadi AH (2016) On the evaluation of asphaltene precipitation titration data: Modeling and data assessment. Fluid Phase Equilib 415:88–100 59. Ghorbani M, Zargar G, Jazayeri-Rad H (2016) Prediction of asphaltene precipitation using support vector regression tuned with genetic algorithms. Petroleum 2:301–306 60. Wang J, Gayatri MA, Ferguson AL (2017) Mesoscale simulation and machine learning of asphaltene aggregation phase behavior and molecular assembly landscapes. J Phys Chem B 121:4923–4944 61. Ristanto T (2018) Machine learning applied to multiphase production problems, pp 1–71 62. Gesho M, Chaisoontornyotin W, Elkhatib O, Goual L (2020) Auto-segmentation technique for SEM images using machine learning: asphaltene deposition case study. Ultramicroscopy 217:113074 63. Ali SI, Lalji SM, Haneef J, Ahsan U, Khan MA, Yousaf N (2021) Estimation of asphaltene adsorption on MgO nanoparticles using ensemble learning. Chemom Intell Lab Syst 208:104220 64. Abdallah D, Punnapala S, Al Daghar K, Kulbrandstad O, Godoy M, Lovell J, Madem S, Babakhani A (2019) From ideation to commercialization-development of the first real-time monitoring device for asphaltene deposition. In: Society of petroleum engineers-SPE gas oil technology showcase conference 2019, GOTS 2019. https://doi.org/10.2118/198615-ms Chapter 6 Machine Learning for Scale Deposition in Oil and Gas Industry Sirisha Nallakukkala and Bhajan Lal Abstract This chapter briefly discusses the type of machine learning methods used for scales precipitation in flow assurance. It also discussed the scale formation predictive models. Keywords Machine learning · Flow assurance · Scales · Predictions 6.1 Introduction In the oil and gas industry, scale precipitation generates a number of issues. Scale precipitation of inorganic salts like (CaCO3 , CaSO4 , BaSO4 , etc.) is a regular occurrence in the oil and gas industry. The sources and causes of this scale formation are diverse. The injection of water might be regarded as the key source of sulfate-scale precipitation resulting due to mixing of water. Scales can also form as a result of changes in the reservoir’s or well tubulars’ thermodynamic conditions. Precipitation can result also due to the changes in temperature, pH, pressure, and partial pressure of carbon dioxide (CO2 )/hydrogen sulphide [1]. 6.2 Source of Scaling in Oil and Gas Industry Scaling in the oil and gas sector is mostly caused by the mixing of incompatible fluids. When two fluids interact chemically, they precipitate minerals. For instance, sea water with a high concentration of SO4 –2 and low amounts of Ca2+ , Ba2+ /Sr+2 , and formation waters with very low concentrations of SO4 2− but high concentrations S. Nallakukkala Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia B. Lal (B) Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia e-mail: bhajan.lal@utp.edu.my © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_6 105 106 S. Nallakukkala and B. Lal of Ca2+ , Ba2+ , and Sr2+ are two examples of incompatible waters. As a result of the mixing of these liquids, CaSO4 , BaSO4 , and/or SrSO4 precipitate. Seawater and field-produced water (disposal water) can be incompatible. Scale deposition occurs when waste water is combined with seawater for re-injection [2]. According to one of the researchers [3] scales resulting from CaCO3 are very usual compared with other kinds of inorganic scales because scaling by CaCO3 is formed either inside the reservoir, within the production tubing, and at the downhole-pump that results in the decrease in efficiency due to plugging. Furthermore, CaCO3 can form scales at the wellhead and in the flow lines [2]. At high temperatures, CaCO3 has a very low solubility constant, making it the most stable scale type at reservoir pressure and temperature [4]. Some of the different forms of scale formations of CaCO3 are calcite, vaterite, and aragonite, and out of which calcite is the most prevalent variety found in the reservoir. Temperature, pH, ion content, such as calcium and bicarbonate, and ionic strength all play a vital role in the development of CaCO3 scale. The conditions that promote the formation of CaCO3 scales include CO2 solubility, pressure and temperature changes, these factors also promote the formation of iron carbonate scales. The release of CO2 will increase the pH of the solution, and thus promote the carbonate scale formation by reducing the scales solubility at higher pH [5]. 6.3 Mechanism of Scale Deposition Scale deposition can occur with water due to supersaturation due to changes in pressure and temperature conditions. When two incompatible waters are mixed and supersaturation is attained then scales can deposit [1]. Supersaturation can be caused by several factors namely heating/cooling, evaporation of water, mixing and gas/liquid equilibria. Supersaturation can occur when a salt solution is cooled or when an inverse solubility salt solution is heated. As water evaporates from solution the solution becomes concentrated making the solution saturated or supersaturated. When the saturated solution comes in contact with hot surface it leads to direct deposition of scale on the surface. Sometimes during mixing the solubility limit may exceed when a soluble salt is added to other salt solution containing similar ion or results in a sparingly soluble salt. In such situations when ionic product is greater than the solubility constant supersaturation condition is attained. Due to the change of solubility with temperature, the mixing of saturated or near-saturated solutions may also result in supersaturation conditions. The equilibrium conditions of CO2 gas dissolved from atmospheric air in solution might affect the solubility of ions. 6 Machine Learning for Scale Deposition in Oil and Gas Industry 107 6.3.1 Types of Scales The types of scales frequently found in flow assurance are, sulfates of (Ba, Sr, Ca), oxides/hydroxides of (Fe, Mg), carbonates of (Ca, Mg, Fe), and sulphides (Fe) are the most prevalent scales found in oil and gas productions. The majority of the scales are either acid soluble or water soluble however, some are not soluble in both. A common example of water-soluble scale is sodium chloride. Acid soluble scales include calcium carbonate, iron sulphide, and iron oxide. 6.3.2 Influence of Impurities on Scale Formation Impurities adsorb on the site of the crystals, deposit and tend to interfere with the solid crystalline structures formation which results in decrease in nucleation and growth followed by change in precipitation. Deposits caused with mixed salts and impurities have a lower adhesion, and the net scaling rate is reduced due to partial removal of the deposit by shear force acting on the flow surface [6]. 6.3.3 Scale Control Methods The nature and concentration of scaling species present in the raw feed determine the severity of a potential scaling challenge in a process. The following are the three basic techniques to controlling scale formation: • Removal/decrease of Scale-forming species • Water treatment is an efficient way to remove scaling issues for instance acidifying the feed and degassing CO2 generated from carbonates, can help avoid alkaline scale formation. • Chemical treatment is best alternative when conventional mechanical removal methods are ineffective or expensive. This is accomplished by employing acids or chelating agents, which are used to break apart acid-resistant scale by isolating and locking up the scale metallic ions within a closed ring-like structure, by allowing the scale minerals to dissolve by increasing their solubility. 6.4 Effect of Scaling to Equipment Pipelines In the oilfield water injection, equipment surface, wellbores and pipelines are prone to scaling resulting in blockage and also increase the corrosion rate of pipeline and increase the speed of sulphate reducing bacteria. Scaling also reduces the heat transfer 108 S. Nallakukkala and B. Lal rate of the equipment resulting in shorter span of the equipment. Scaling also results in reducing the surface area of the channel by creating blockage and effecting the permeability of the reservoir. 6.5 Scale Inhibition Placement 6.5.1 Scale Inhibition Placement by the Squeeze Technique The common approach for injecting the inhibitor into the formation is to inject it into the water zone at high pressures followed by a brief shut-in time period. Certain conditions govern which inhibitor should be squeezed: first, the ability of the chemical to inhibit at low/high concentrations; second, the inhibitors ability to be adsorbed by the surface as well as that surface’s ability to hold the fluid; and third, the fluid’s ability to slowly release from the rock to maintain the minimum inhibitor concentration required for several months. The isotherm of desirable inhibitor should rise quickly and then decrease as the inhibitor concentration rises. Sometimes precipitation suggests that calcium salt may precipitate and coat the reservoir rock [7]. As a result, a large number of calcium ions attach to a single scale inhibitor molecule, as shown in the reaction below: INHIBITOR(Scale Inhibition) + Ca2+ ← SI_Ca[the inhibitor complex] 6.5.2 Pumping the Inhibitor with the Stimulation This approach has the advantage of being cost-effective because by using the same equipment both stimulation and inhibition can be performed at the same time. Smith et al. discovered that using too many scale inhibitors can interfere with the corrosion control agent in the HCl acid system [8]. 6.5.3 Pumping the Inhibitor with Fracturing Fluid The opportunity to place the inhibitor fluid in the entire fracture is the main advantage to include inhibitor in the fracturing fluid. This method is cost-effective and easy to implement unless it doesn’t disturb the rheology of the fracturing fluid. 6 Machine Learning for Scale Deposition in Oil and Gas Industry 109 6.5.4 Inhibitor Impregnated into Proppant When the fracture is at risk of deterioration due to the scale, this treatment is used. The inhibitor adsorbs in the microscopic crevices of the proppant particles and is slowly released with the produced water. 6.6 Prediction Models Available for Scale Formation Detection During exploration of oil and gas from reservoirs, scaling is caused due to presence of water which affects the oil production [9]. Scaling is very complex issue that results due to changes in production parameters like the phase change, chemical reactions in the electrolyte solution, temperature, pressure, rate of dissolution, evaporation and precipitation adversely affect the scaling [10]. The scaling prediction has been explored extensively since the 1930s. Over the years, newer and more reliable scaling prediction models have been developed. Some of the scaling prediction tools or methods used presently are the. • Saturation index, • Solubility product rule, • Ion association theory. Water composition, temperature, pressure, mass and energy transfer [11] also affect the scaling in a reservoir. A new index was developed [12] to predict the carbonate scaling by saturation index method. Another researcher [13] predicted the carbonate scale using the thermodynamic solubility method and sulphate solubility product. The influence of various parameters like temperature, pressure and formation water composition on scaling are considered but phase change is not considered by these prediction models. As a result, they cannot accurately depict the inorganic salt scaling process in the reservoir. Hence its required to develop a model that takes phase change into consideration under high pressure and high temperature conditions. A multiphase scaling prediction model based on thermodynamics was proposed by Zheng et al. [14] that considers phase change, and reaction of inorganics salts scaling under multiphase equilibrium. The Oddo-Tomson saturation index was a common technique to predict the scaling in an electrolyte solution. 6.6.1 Saturation Index The Langelier Saturation Index (LSI) is an equilibrium model derived from the theoretical idea of saturation that provides indicator of degree of water saturation with respect to calcium carbonate. 110 S. Nallakukkala and B. Lal Langelier saturation index (LSI) is given as. LSI = pH + TF + CHF + AF – 12.1 (TDS factor). where TF is the temperature factor. CHF is calcium hardness factor. AF is alkalinity factor. and 12.1 is a constant value for 1000 ppm of total dissolved solids (TDS). If the LSI < 0: There is no risk of scaling because the water will dissolve the CaCO3 . If the LSI > 0: Scale can form and result in precipitation of CaCO3 . If LSI ∼ = 0: Borderline scale potential. The index could be affected by changes in water quality, temperature, or evaporation. LSI is purely an equilibrium measure that only considers the thermodynamic driving force for the formation and growth of CaCO3 scales. 6.6.2 Inhibitor Impregnated into Proppant The insoluble electrolyte Am Bn (s) exhibits the following chemical equilibrium in solution at a given temperature and pressure: Am Bn (s) ⇔ m An+ (aq) + n B m− (aq) K sp = [An+ ]m · [B m− ]n where K sp is the thermodynamic solubility product of Am Bn (s) To analyse the scaling in the case of insoluble electrolyte solution the following rules can be utilised to analyse the occurrence of dissolution/precipitation. Rule 1: [An+ ]m · [B m− ]n >K sp : solution is saturated. Rule 2: [An+ ]m · [B m− ]n <K sp : solution is unsaturated. Rule 3: [An+ ]m · [B m− ]n =K sp : solution is in equilibrium. 6.6.3 Ion Association Theory When two ions of different charges are available their columbic force of attraction is greater than the thermal motion and results in the formation of a new distinct entity having substantial stability. A mature scaling prediction approach has been developed after years of scientific investigation, application, and observation. The Langelier saturation index method 6 Machine Learning for Scale Deposition in Oil and Gas Industry 111 [15], Davis stiff saturation index method [16], and Ryznar stability index method [17] are all used to predict the CaCO3 scaling. Methods like the Oddo-Tomson saturation index approach [18] and the OLI ScaleChem scaling prediction software [19] are implemented for mixed scale prediction. It’s critical to avoid scaling in oil and gas field and the factors that influence the scaling are numerous [20]. The ability to forecast the scaling trend, volume, and kind of produced water is critical. It’s also critical to control the water quality index of produced water, which is critical for scaling management. Although the oilfield generated scaling prediction technologies have improved over time, there are still significant limitations Most scaling prediction approaches, for example, are solely based on thermodynamic parameters and do not take into consideration the crystallisation kinetics or fluid dynamics. This will lead to a more comprehensive, targeted, and accurate scaling prediction mechanism. 6.7 Machine Learning for Scale Deposition Machine learning techniques is a prediction tool while artificial intelligence (AI) is more related to the process of developing machines with the help of human intelligence. Both machine learning and AI are fascinating technologies that combine computing power with human intelligence to provide clever and consistent results to nonlinear and complex problems. Al-Hajri et al. [21] focussed on use of machine learning techniques such as. • K-Nearest Neighbour (KNN) algorithms, • Gradient boosting classifier, • Decision tree, • SVM, and • Gradient boosting. 6.7.1 K-Nearest Neighbor KNN is a supervised learning algorithm that is used for classification and regression problems. The input parameter consists of k closest training examples in feature space environment and the outer parameter rely on whether KNN is used for utilization or regression. 6.7.2 Gradient Boosting Classifier It is a boosting algorithm that collectively associates several weak models to create a strong predictive model to maximise a cost function across function space. Beyond 112 S. Nallakukkala and B. Lal regression and classification, this functional-gradient approach of boosting has led to the development of boosting algorithms in a variety of domains of machine learning and statistics. 6.7.3 Decision Tree This method uses decision tree to get observations and reach to conclusions about the item’s target (from branches to leaves). It is a predictive model which is used in data mining, statistics, and machine learning. 6.7.4 Support Vector Machines (SVM) In machine learning SVM is a supervised learning model associated with learning algorithms used in classification and regression analysis to analyse data. The SVM training technique creates a model that allocates new samples to one or different categories, making it a binary linear classifier that is non probabilistic. 6.7.5 Gradient Boosting It is a machine learning technique for regression and classification problems that generates a prediction model in the form of a collection of weak prediction models, usually decision trees. It constructs the model in a staged manner, similar to previous boosting methods, and it generalises them by allowing optimization of any function. False Negative (FN) tool is used to predict the formation of scale. Castillo et al. [22] discussed for function approximation problems. The combination of artificial neural networks with functional theory is the foundation of FN. It’s a supervised data-learning technique that’s typically utilised for regression and prediction. Al-Hajri et al. [21] described stepwise methodology for CaCO3 prediction elsewhere. This can be further extended to include probabilistic framework by which scale inhibition is designed. The data is divided randomly into 80% training and 20% testing then generate a confusion matrix that describes the performance of prediction and later define the probabilistic equations used to quantify the data. The data sets used for prediction include both single data sets associated with single wells and as well multiple data sets from same well. All techniques resulted good accuracy, but KNN was chosen further because of its capability to develop classification plots. 6 Machine Learning for Scale Deposition in Oil and Gas Industry 113 6.8 Applications of Artificial Intelligence in Oil Desalination Systems 6.8.1 FN Tool to Develop Scale-Formation Correlation The FN tool, is used to predict the presence of scale formation. An FN technique is a relatively new AI technique that was first presented for a function-approximation problem by Castillo et al. [22]. The combination of artificial neural networks with functional theory is the foundation of FN. It’s a supervised data-learning technique that’s typically utilised for regression and prediction. A quality check of the data set is executed before the data is fed into AI model. After removing the outliers 70% of data is used for model training and 30% for testing the trained models. The training model selected is the backward elimination method because of its high precision and short processing time. The fitness criteria adopted is minimum description length. Minimum description length is given as δ= Np plog N p + log π 2 2 2 (6.1) where N p is number of parameters and π is the root mean square error given as / π= 1 Σ 2 ∈ N i=1 i Np (6.2) The mathematical model for scale formation is. Scale formation = Np Σ ωi N a σ 1i Ca σ 2i Mg σ 3i S O 4 σ 4i H C O 3 σ 5i T DS σ 6i p H σ 7i, T σ 8i, i=1 Where Na, Ca, Mg, SO4 , HCO3 are the molar concentrations of sodium, calcium, magnesium, sulphate, bicarbonate ions expressed in mol/l and TDS is the total dissolved solids, pH is the acidity of solution and T is the normalised inspection time. If the output of the model is 1 then it represents precipitation and if the output is 2 it means no precipitation. Further applicability of this model and method on types of scale can be analysed and studied. The applicability of least square support vector machine (LSSVM) was implemented [23] to estimate the amount of dissolved calcium carbonate in oil field brine is performed where the LSSVM is coupled with genetic algorithm to determine hyper parameters (σ 2 ,γ). 114 S. Nallakukkala and B. Lal 6.8.2 Least Square Support Vector Machine (LSSVM) SVM is an effective approach and is widely used in pattern recognition, classification and regression [24], As SVM is based on quadratic programming and its time consuming but is unique unlike other regression techniques such as neural networks [25]. An alternative to SVM regression, LSSVM was suggested by Suykens et al. [26] where it needs linear programming which is rather simpler to deal with. The concentration and amount of dissolved CaCO3 in oil field brines is predicted by Ahmadi et al. [23] using LSSVM model with temperature and pressure as two inputs. A populationbased GA was applied to estimate the hyper parameters along with LSSVM. The results obtained from vector model followed the real data points with high precision with a relative deviation span from –4.26% to 4.56% and average absolute deviation of 1.712%. GA along with LSSVM resulted in consistent output results with R2 value of 0.9994 and mean square error of 0.0000208 for predicting dissolved CaCO3 in oil field brines. LSSVM has better characteristics like efficiency, can model highly non-linear systems in oil diesel system and can be calculated easily. 6.8.3 Scale Thickness Measurement Using Gamma-Ray Densitometer Methods like acoustic and non-acoustic methods have been implemented for scale formation detection in oil wells. Based on the reflection of signal the thickness and type of scale can be identified through acoustic method. Non acoustic methods are reliant on monitoring temperature and pressure showing the occurrence of problem at later stage. Gamma-ray densitometer provides reliant data to accurate density fluctuations in industries. This method also provides real time analysis to determine the wall thickness in pipes [27]. The gamma-ray densitometer is based on transmission measurements of gamma beam to determine the density of material. A radiation detector records the transmitted gamma-ray flux through wall of pipes and inner fluids. In addition, artificial neural networks is used to interpret the pulse height distribution obtained by the gamma detector for prediction of scales [28]. Salgado et al. [29] investigated the response of multiphase system to gamma-ray detection to predict the scale thickness based on PHD pattern recognition by means of trained ANN using data generated by Monte Carlo code. The results showed a relative error of 0.60% and 94% of data were predicted with a relative error less than 5%. The results indicate that this methodology can be used as ANN could predict the scale thickness with acceptable results. To investigate the formation of barium sulphate scales (BaSO4 ), a measurement approach based on gamma-ray scattering was devised[30] using three NaI(Tl) detectors and a 137 Cs gamma-ray source to detect the thickness of scale. The data from the detectors was utilised to train an ANN to predict maximum scale thickness values regardless of the presence of oil, saltwater, gas, or scale inside the tube. The Monte Carlo MCNP6 algorithm was used to create a data subset for 6 Machine Learning for Scale Deposition in Oil and Gas Industry 115 training and evaluating the ANN generalisation capability. The maximum scale value was studied at various thicknesses and places and more than 90% of the patterns had relative errors of less than 10%, according to the findings. 6.8.4 Prediction of CaCO3 Scaling Using MLP and PNN Artificial intelligence-based numerical analyses such as Multi Layer Perceptron (MLP) Probabilistic Neural Network (PNN) were used by Paz et al. [31] to predict CaCO3 scaling using SI method for scaling solutions. The software KNIME Analytic with an MLP structure based on ANN was used to investigate the feasibility of producing predictions about the saturation index of CaCO3 scaling difficulties. Both MLP and PNN approaches produce good results for both types of data, the first being utilised in the learning process and the second being used to test the ANN methods. When this method is combined with external data, it is possible to forecast CaCO3 scaling under circumstances such as temperature, solution pH, and solution concentration that are often known from similar experimental studies. 6.8.5 Prediction of BaSO4 /CaSO4 Oilfield Scale Using ANN and SNN Previous scale formation prediction methods relied mostly on thermodynamics and limited solubility data, and thus could only predict the potential to scale formation. However, no research has looked into the impact of kinetic and transport factors. Statistical Neural Network (SNN) has proven to be effective tool at estimating imprecise and noisy data sets. It’s been discovered to be useful in any field that uses both qualitative and quantitative data. In another study by Falode et al. [32] used an Artificial Neural Network and a Statistical Neural Network to predict the production of BaSO4 and CaSO4 oilfield scales while accounting for thermodynamic, transport, and kinetic parameters. This was accomplished by utilising Neural Network Toolbox in Matlab R2009a to create a neural network model, train, test, and verify data. From the study it was discovered that the obtained results from the network were a better match than the needed results, indicating that the network can be used to predict the amount of BaSO4 precipitation and rate of reaction for CaSO4 at a given temperature/pressure indicating that the developed ANN and SNN had good validating results, and high confidence in the prediction. 116 S. Nallakukkala and B. Lal 6.9 Case Studies on Scaling Measurement Using Machine Learning 6.9.1 Effective Control of Deposition of Scale Using AI in Vacuum Pump The strategy and function of AI at HABER in addressing one of India’s largest integrated paper mills’ concerns with scale deposition in the vacuum pump. As water removal is a time-consuming and energy-intensive procedure in the paper industry the vacuum formed by a liquid ring vacuum pump is employed once dewatering is completed. Because the cost of removing water is higher in the dryer portion, an effective vacuum process would mean a lower cost of water removal. It is impossible to totally avoid mineral salt deposition. However, careful risk analysis and a focused strategy towards scale prevention can help to reduce costs and impacts. The ELIXA® technology from HABER delivers closed-loop control for vacuum pump scale control programmes using real-time artificial intelligence and machine learning. IoT sensors capture real-time data on many process parameters that affect vacuum pump performance, and big data analysis takes place on the ELIXA® cloud. The ELIXA® programme forecasts the need for anti-scalant in the system in real time based on the process circumstances. This predicted output is set as set point to the final control element. AI/ML-based automation eliminates bottlenecks in manual operations such as frequent sampling on a daily basis, resulting in a delay in taking appropriate decisions. In addition, data points alone were insufficient to provide insights or useful intelligence. When these issues are resolved, scale deposition can be controlled precisely, efficiently, and reliably. The impact that was made as a result of the implementation of AI is. • The use of anti-scalant chemicals was decreased by 20%, resulting in significant annual savings. • Cleaning of vacuum pumps has been reduced by 50%. 6.9.2 Conclusion It’s critical to avoid scaling in oilfield development, and the factors that influence the scaling in gas fields are numerous. The ability to forecast the scaling trend, volume, and kind of produced water is critical. It’s also critical to control the water quality index of produced water that is of great significance in the scale management and removal. Although oilfield generated water scaling prediction technologies have improved over time, there are still significant challenges. The rate constant was predicted for calcium sulphate at given temperature, flowrate and pressure using ANN. Machine learning techniques were also implemented to predict the scaling of calcium carbonate. This study proves that machine learning could correctly predict 6 Machine Learning for Scale Deposition in Oil and Gas Industry 117 the scale thickness in multiphase system. Future research into the applicability of machine learning to various types of scale development can be examined, as well as the capacity to forecast the critical value of salt precipitation when it becomes an issue in oil and gas fields. References 1. Moghadasi J, Jamialahmadi M, Müller-Steinhagen H, Sharif A (2001) Scale formation in oil reservoir and production equipment during water injection (Kinetics of CaSO4 and CaCO3 Crystal Growth and Effect on Formation Damage). In: SPE European formation damage conference, pp 11–18 2. Paulo J, Angola C, Mackay EJ, Menzies N, Poynton N (2001) Implications of brine mixing in the reservoir for scale management in the Alba field. Soc Pet Eng Int Symp Oilf Scale 2001:1–6 3. ShanthanaLakshmia D, Senthilmurugan B, Driolia E, Figoli A (2013) Application of ionic liquid polymeric microsphere in oil field scale control process. J Pet Sci Eng 112:69–77 4. Kamal MS, Hussein I, Mahmoud M, Sultan AS, Saad MAS (2018) Oilfield scale formation and chemical removal: a review. J Pet Sci Eng 171:127–139 5. Jordan MM, Williams H, Linares-Samaniego S, Frigo DM (2014) New insights on the impact of high temperature conditions (176°C) on carbonate and sulphate scale dissolver performance. In: Society petroleum engineers-SPE international conference exhibition oilfield scale 2014. pp 495–511 6. Bin Merdhah AB, Mohd Yassin AA (2007) Scale formation in oil reservoir during water injection at high-salinity formation water. J Appl Sci 7:3198–3207 7. Kahrwad M, Sorbie KS, Boak LS (2008) Coupled adsorption/precipitation of scale inhibitors: experimental results and modeling. In: SPE production and operations, pp 481–491 8. Smith PS, Clement CC, Mendoza Rojas A (2000) Combined scale removal and scale inhibition treatments. In: Society petroleum engineers-International symposium oilfield scale 2000, pp 1–6 9. Jing G, Tang S, Li X, Wang H (2017) The analysis of scaling mechanism for water-injection pipe columns in the Daqing Oilfield. Arab J Chem 10:S1235–S1239 10. Wang N, Chen DZ, Zou LS (2015) Influence of non-thermal plasma pre-treatment on the scaling characteristics of viscous oil wastewater during evaporation. Appl Therm Eng 75:779–788 11. Peyghambarzadeh SM, Vatani A, Jamialahmadi M (2012) Application of asymptotic model for the prediction of fouling rate of calcium sulfate under subcooled flow boiling. Appl Therm Eng 39:105–113 12. Ryznar JW (1944) A new index for determining amount of calcium carbonate scale formed by a water John. J Am Water Work Assoc Water Work Assoc 36:1–3 13. Al Nasser WN, Al Salhi FH (2013) Scaling and aggregation kinetics determination of calcium carbonate using inline technique. Chem Eng Sci 86:70–77 14. Zheng, Heng CP (2019) Comprehensive research of scaling prediction for gas reservoir fluid considering phase state. Geofluids 1–24 15. Ozair G (2012) An overview of calcium carbonate saturation indices as a criterion to protect desalinated water transmission lines from deterioration. Nat Environ Pollut Technol 11:203– 212 16. Langelier WF (1936) The analytical control of anti-corrosion water treatment. J Am Water Work Assoc Water Work Assoc 28:1500–1521 17. Kamari A, Gharagheizi F, Bahadori A, Mohammadi AH (2014) Determination of the equilibrated calcium carbonate (calcite) scaling in aqueous phase using a reliable approach. J Taiwan Inst Chem Eng 45:1307–1313 118 S. Nallakukkala and B. Lal 18. Bedrikovetsky PG, Lopes RP, Rosário FF, Bezerra MC, Lima EA (2003) Oilfield scaling-Part I: mathematical and laboratory modelling. In: Proceedings of SPE Latin America Caribbean petroleum engineers conference, pp 810–823 19. Oddo JE, Tomson MB (1994) Why scale forms and how to predict it. SPE Prod Facil 9:47–54 20. Yan Y, Yu T, Song J, Wu B, Qu C (2021) A review of prediction methods for oilfield produced water scaling. IOP conference series: earth and environmental science. https://doi.org/10.1088/ 1755-1315/651/3/032052 21. Al-Hajri NM, Al-Ghamdi A, Tariq Z, Mahmoud M (2020) Scale-prediction/inhibition design using machine-learning techniques and probabilistic approach. SPE Prod Oper 35:987–1009 22. Castillo E, Cobo A, Gutiérrez JM, Pruneda RE (1999) Functional Networks with Applications. In: Functional networks with applications, pp 1–7 23. Ahmadi MA, Bahadori A, Shadizadeh SR (2015) A rigorous model to predict the amount of dissolved calcium carbonate concentration throughout oil field brines: side effect of pressure and temperature. Fuel 139:154–159 24. Cortes C, Vapnik V (1995) Support-vector networks. Mach Learn 20:273–297 25. Vong CM, Wong PK, Li YP (2006) Prediction of automotive engine power and torque using least squares support vector machines and Bayesian inference. Eng Appl Artif Intell 19:277–287 26. Suykens JAK, Vandewalle J (1999) Least squares support vector machine classifiers. Neural Process Lett 9:293–300 27. Ramirez GF, Feliciano HJ (1992) Methodology to calculate wall thickness in metallic pipes 28. Salgado CM, Pereira CMNA, Schirru R, Brandão LEB (2010) Flow regime identification and volume fraction prediction in multiphase flows by means of gamma-ray attenuation and artificial neural networks. Prog Nucl Energy 52:555–562 29. Salgado WL, Dam RS de F, Teixeira TP, Conti CC, Salgado CM (2020) Application of artificial intelligence in scale thickness prediction on offshore petroleum using a gamma-ray densitometer. Radiat Phys Chem. https://doi.org/10.1016/j.radphyschem.2019.108549 30. Salgado CM, Salgado WL, Dam RS de F, Conti CC (2021) Calculation of scales in oil pipeline using gamma-ray scattering and artificial intelligence. Meas J Int Meas Confed. https://doi.org/ 10.1016/j.measurement.2021.109455 31. Paz PA, Caprace JD, Cajaiba JF, Netto TA (2017) Prediction of calcium carbonate scaling in pipes using artificial neural networks. Proc Int Conf Offshore Mech Arct Eng OMAE 5A– 2017:1–5 32. Falode O, Udomboso C, Ebere F (2016) Prediction of oilfield scale formation using artificial neural network (ANN). Adv Res 7:1–13 Chapter 7 Machine Learning in CO2 Sequestration Amirun Nissa Rehman and Bhajan Lal Abstract CO2 capture and sequestration is a prominent field of study with high research demands. It involves capturing CO2 from various large point sources and storing it to prevent its emission. Various conventional CO2 sequestration techniques currently in practice involve CO2 storage in geological formations such as depleted oil and gas reservoirs, saline aquifers, and enhanced oil recovery (EOR) applications. Another emerging technique is to store CO2 in the hydrate form in marine sediments owing to its large storage capacity. Gas hydrates are crystalline solid structures formed by the physical combination of gas (such as methane, carbon dioxide, propane, etc.) and water molecules at high-pressure and low-temperature conditions. This chapter briefly describes the conventional CO2 sequestration techniques with the challenges encountered in their application. Further, the chapter discusses the use of machine learning in gas hydrate related studies particularly concerning hydrate-based CO2 capture and sequestration. Keywords Machine learning · CO2 capture and sequestration · Flow assurance · EOR 7.1 Introduction Due to the rising CO2 emissions causing climate change, carbon dioxide (CO2 ) storage has become a crucial concern. Nearly 55.46% of the total global greenhouse emissions are attributed to human activity [1–3]. Another 41% of CO2 emissions comes from power generation [4, 5]. The escalating global temperatures are due to the increasing amount of greenhouse gases (such as CH4 , CO2 , N2 O, etc.) of which CO2 is the major contributor (72%) [6–8]. The United Nations has advocated an A. N. Rehman · B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_7 119 120 A. N. Rehman and B. Lal international action to maintain the global temperature rise below 1.5 °C by 2030 in response to the growing concerns from climate change [9]. In order to support the current policies and actions, it is important to develop efficient CO2 storage technologies. Currently, CO2 storage technologies are still an area under exploration and needs further investigation [10]. The currently existing storage techniques for Carbon Capture and Storage (CCS) involve the injection of captured CO2 from large sources into deep geological formations, depleted gas reservoirs, deep saline aquifers as recovery agents in enhanced oil recovery (EOR), and unmineable coal seams [11]. In each case, the trapping efficiency depends upon the migration rate of CO2 , which relies on the rock and fluid characteristics of the geological site. The efficiency of CO2 storage also depends on multiple factors, including specific properties of the storage aquifer, such as temperature, pressure, salinity, and heterogeneity. Various modelling/simulation techniques have been used to predict these parameters. Recently, machine learning techniques have proved to be useful in predicting these conditions in various applications including CO2 sequestration. Especially concerning the leakage of CO2 arising from faults during CO2 injection, machine learning helps in monitoring such leakage by predicting the uncertainties and avoiding risks involved. It is also used to study the various kinds of flow behaviour involving gas, water and oil in reservoirs through predicting the flow. In this chapter, the various conventional geological CO2 sequestration methods are elaborated. Also, new approaches employing machine learning techniques in CO2 sequestration is discussed. 7.2 Conventional CO2 Sequestration Techniques The various conventional CO2 storage/sequestration methods that are in practice currently include Enhanced Oil Recovery (EOR), depleted gas reservoirs, unmineable coal seams, and potential basalts [12], as shown in Fig. 7.1. This section briefly discusses the details of conventional CO2 storage methods. 7.2.1 Enhanced Oil Recovery Several mitigation strategies considering CO2 emissions are focused in EOR applications where CO2 is replaced with oil while recovery [13–20]. CO2 can be stored in reservoirs by two mechanisms, either physically or by chemical means [21]. The physical storage method includes structural, stratigraphic, and residual capture involving underground CO2 injection where there is a high probability of upward migration due to buoyancy. Whilst chemical storage mechanisms involve mineral trapping and solubility. In the case of solubility, CO2 dissolves into formation water and is stored by dissolution, while mineral trapping consists of the formation of solid 7 Machine Learning in CO2 Sequestration 121 Fig. 7.1 Geological carbon dioxide storage techniques carbonates. But the major drawback of mineral trapping is that it takes a very long time to occur [22, 23]. In this regard, carbon capture, utilization, and storage (CCUS) technology play an important role in EOR operations that allow capturing CO2 from anthropogenic emission sources providing the dual advantage of reducing greenhouse emissions while simultaneously facilitating storage [24]. There are different ways of trapping CO2 , residual trapping, hydrodynamic trapping, and aqueous solubility trapping. Due to the high solubility of CO2 in oil, its fraction in the oil phase is much more compared to that in the supercritical (hydrodynamic) phase and the aqueous phase [25]. Jia et al. [13] employed Monte Carlo simulations unified with reduced-order models (RMO) to evaluate the solubility of CO2 by oil trapping, aqueous trapping, and hydrodynamic trapping. They developed reduced-order models combined with Polynomial Chaos Expansion (PCE) technique considering porosity and permeability as the uncertainties. They found that CO2 is carried upward at the beginning of injection due to buoyancy while after complete injection, dissolved CO2 moves downward because of an increase in oil and brine density. This technique could store CO2 with an overall storage efficiency of 10–56% [26]. CO2 -EOR miscible process is another technique that allows CO2 storage with simultaneous oil production. The CO2 storage capacity in this method is increased by increasing the cumulative gas injection concurrently with slug length [27]. However, for successful storage, key factors like reservoir depth, pressure, temperature, and storage capacity of the reservoir should be properly maintained to avoid huge financial expenses [24]. In addition, CO2 -EOR combined with CCS technology is found to be unfeasible from a thermodynamics point of view as more energy is consumed in the process than produced [28]. The highest EOR potential and CO2 storage 122 A. N. Rehman and B. Lal capacity is achieved in low permeability reservoirs; however, heterogeneous reservoirs show poor EOR due to early gas breakthrough arising from high permeability channels [27, 29]. Model predictions report CO2 storage efficiency within a range of 70%-100%. However, off-shore application of CO2 -EOR technology has critical challenges involving commercial and financial risks [30]. According to Ampomah et al. [31] the trapping mechanism of CO2 involved structural-stratigraphic trapping, CO2 dissolution in formation water, and residual trapping. The simulation shows that a huge amount of CO2 can be stored in residual trapping compared to the other methods. However, although widespread, EOR techniques face the principal challenge of high injection cost, making it capital and resource intensive and expensive [32]. It also has several other constraints, including uncertainty in reservoir properties like porosity, permeability, caprock integrity, and fluid volume present in the reservoir. This uncertainty hinders to estimate the nature of trapping CO2 and its distribution in the reservoir [13]. Further, pressure, temperature, depth of the reservoir, rate of CO2 injection as well as the effect of temperature on relative permeability of oil– water systems [33] are crucial parameters that need to be monitored closely for effective storage of CO2 . Continuous monitoring of reservoir pressure is essential as elevated pressure beyond the reservoir’s capacity may induce caprock fracture and CO2 leakage [34]. In addition, the size and location of the reservoir from the source of CO2 are important parameters that govern the storage capacity in CO2 -EOR applications. The reservoir must be situated at a certain distance from the source and should have a minimum storage capacity equivalent to a given number of years of CO2 emission [24]. Another limitation of CO2 storage via EOR is multiple wells reaching up to hundreds and thousands that need to be continuously monitored [35]. 7.2.2 Depleted Reservoirs Depleted reservoirs are another form of widely practiced geological sequestration method for CO2 storage [36]. Storage in depleted reservoirs has been extensively studied considering various aspects, like geochemical modeling, underground migration simulation, risk assessment, and long-term integrity [36]. In the case of depleted reservoirs, CO2 is disposed off by the replacement of the underground fluids and gases generated from the reservoir with supercritical CO2 [37]. However, several factors govern this whole mechanism. CO2 injection pressure is a major contributing factor in terms of the original reservoir pressure and fracture pressure of the rock. For safe sequestration, the pressure of injected CO2 must be lower than the original reservoir pressure as well as fracture pressure [38]. However, when CO2 is injected, it alters the interfacial tension between the CO2 /water system causing leakage by volume flow, and this further affects the gas permeability impacting the storage capacity [39]. Lei et al. [40] investigated the geological storage of CO2 in Huangcaoxia Gas Reservoir (Eastern Sichuan Basin, China) using numerical simulation. They developed a combined thermal-hydrodynamic model considering faults depending on the 7 Machine Learning in CO2 Sequestration 123 geological and hydrogeological conditions in the Huangcaoxia gas field. They found that the best CO2 storage occurred at a downhole temperature greater than 80 °C at downhole pressure of 14 MPa. However, uncertainties in terms of reservoir conditions like the thickness of the reservoir, permeability, effect of formation water, and water–rock-gas interactions still exist that challenge its extensive applicability. It has been observed that storage capacity largely depends on residual fluids’ pressure and compressibility in the pores. In 2017, Clarke et al. [41] confirmed that the reservoir drive mechanism influenced the storage capacity. Agartan et al. [42] improved the material balance-based correlation that allowed direct estimation of the CO2 storage volume using existing production data. Depleted condensate gas medium provides an improved storage potential compared with dry and wet reservoirs [43]. In 2018, Myshakin et al. [44] studied the CO2 storage efficiency in fractured shale reservoir employing FRACGEN and NFFLOW simulator. Bender and Akin [45] claimed that CO2 storage capacity is possible in CO2 flooded oil reservoirs. The feasible characteristics that make depleted oil and gas reservoirs fit for CO2 storage applications are already established underground surface infrastructure, including wells and pipelines [39]. In addition, oil and gas reservoirs have been extensively investigated, which gives an added advantage to use the experience in CO2 sequestration. However, the risks underlying in applying this technique are far more serious. Wellbore integrity is one of the top risks where pressure resulting from production followed by injection weakens the wellbore seal interface causing leakage [46]. Gas mixing is another critical issue in storing CO2 , because the presence of CO2 in a natural gas mixture degrades the quality of the natural gas feed. Reactivity of CO2 with caprock materials also affects the storage mechanism. Apart from this, reservoir pressure, depth, and distance between the reservoir and production source are additional factors that largely influence the storage capacity [47]. 7.2.3 Deep Saline Aquifers Deep saline aquifers appear to be a viable technology for CO2 storage representing the best-salted sink among all geological storage options. Storage efficiency in saline aquifers depend on several factors, including storage aquifer characteristics like pressure, temperature, water salinity, porosity, permeability, heterogeneity, and CO2 injection rate [48]. Apart from these, the criteria that favor the proper selection of storage sites include the capacity of storage, injectivity, and containment. The storage site should possess sufficient pore volumes allowing more CO2 to be stored in terms of capacity. In terms of injectivity, permeability should be high to maintain injection rates as desired [49]. The trapping mechanism of CO2 also highly influences the storage capacity, containment as well as injectivity. For successful storage in saline aquifers, the injection of supercritical CO2 is preferred. The Alberta saline basin’s storage capacity has been estimated as 103 Gt CO2 considering solubility trapping [50]. Junin and Abang [51] evaluated the CO2 storage potential in deep saline formations in Malaysian sedimentary basins. They performed 124 A. N. Rehman and B. Lal geographic information system analysis integrated with field assessment data to identify potential storage sites within the basin for CO2 storage and found that 27% of the basin revealed a high potential for storing CO2 . In 2008 Zhou et al. [52] evaluated the storage capacity and expected pressure build-up during storage operations using an analytical model. Literature studies report the use of various numerical modeling techniques, including streamline simulation, vertical equilibrium models, and conventional grid-based numerical models for evaluating CO2 storage [53–55]. Among all streamlines, simulations were the fastest as they reduced the flow equations to a one-dimensional equation. Knopf and Mary [56] estimated the CO2 storage capacity based on two different methods- regional aquifer based versus trap based method. They found that the regional aquifer-based method yielded enhanced storage capacity. Cui et al. [57] employed a comprehensive fluid-rock interaction model to study CO2 storage behavior. In another study, the CO2 storage capacity in saline aquifers was assessed by mineral trapping that considered consumption of CO2 through geochemical reactions with rock minerals within the reservoir [58]. The CO2 storage process in saline aquifers is governed by several physical parameters like viscous force, capillary force, and buoyancy arising from density difference between injected CO2 and aquifer brine. This difference in density leads to upward migration of CO2 [59] followed by gravity segregation and additional migration to the surface causing leakage [60]. Furthermore, the storage capacity depends on numerous factors where CO2 solubility is considered a prime component. It has a substantial impact on the storage capacity as it determines the amount of gas dissolved in brine. Neglecting this effect will underestimate the storage capacity of up to 16% [61]. The density of CO2 at reservoir conditions, interconnected pore volume, and fluid property are supplementary factors influencing CO2 storage. Another significant risk underlying in the case of CO2 storage in saline aquifers is the high possibility of leakage, thereby contaminating drinking water and harming vegetation. This leakage arises from defective wells, especially in regions containing many wells [62]. Further estimation of storage capacity in saline aquifers is complicated due to a lack of information and numerous trapping mechanisms operating in different time scales [61]. 7.2.4 Unmineable Coal Seams Methane recovery by CO2 replacement in coal seams is another technique that accounts for CO2 storage. CO2 has been employed in several enhanced coal bed methane recovery processes that amplify methane recovery providing simultaneous CO2 storage [63–65]. In this process, CO2 molecules diffuse through the network of fractures within the coal bed into the matrix and desorb methane. CO2 can be stored either as free gas within the pore space, dissolved in the groundwater inside the coal, or adsorbed on the coal surface. In this case, CO2 binds physically to the coal surface through adsorption trapping it permanently on the coal, provided adequate pressure is maintained [66]. Because of the high affinity of CO2 towards the coal matrix than methane, upon CO2 injection, it immediately replaces methane on the coal surface. 7 Machine Learning in CO2 Sequestration 125 CO2 adsorption affects coal permeability, and data from previous literature reveal that CO2 exposure to coal results in coal swelling [67, 68]. For successful CO2 injection, a coal seam must possess sufficient permeability along with pores. Ibrahim and Nasr-El-Din [69] studied the effect of salinity of coal seam water, the composition of the injected gas, and formation pressure on CO2 sequestration in bitumen coal by core flooding experiments using coal cores. They measured variation in permeability arising from CO2 adsorption and found that permeability reduction was significant with high salinity. Another study conducted by Reeves et al. [70] show similar results of CO2 adsorption that prompt swelling of the coal matrix, ultimately decreasing permeability and injectivity. Zhiming and Xiaochun [71] evaluated the effect of coal swelling under stress conditions by adsorption of carbon dioxide, nitrogen, and methane, respectively. The effect of CO2 injection on coal porosity and permeability were studied theoretically by Mazumdar and Wolf [72]. They further measured coal swelling in CO2 -ECBM experiments. Romanov [73] used CO2 adsorption to study the difference in swelling between block samples and powdered samples. Romnav et al. [74] further measured the adsorption capacity by examining the impact of CO2 adsorption induced coal swelling. CO2 storage in coal seams is an attractive approach providing the additional benefit of methane recovery in enhanced coal bed methane (ECBM) process. CO2 preferentially absorbs to coal surface, replacing methane, thereby facilitating enhanced methane recovery. This technique also serves as a potential resource for large volumes of CO2 storage in the U.S. Further, it helps to reduce greenhouse emissions alleviating the effect of global warming. However, there are several challenges associated with this technique. Storage of CO2 in any type of coal bed is not possible as the stored CO2 makes the coal unfit for future energy purposes. Thus, according to the U.S. Congress Act, only unmineable coal may be considered for CO2 storage [75]. With increasing depth, the permeability declines exponentially, which affects successful CO2 injection. Therefore, high permeability is desired for high CO2 injection. CO2 adsorption further reduces permeability due to coal swelling. At greater depths (approximately 1000 m), CO2 is found in a supercritical state that diffuses into and plasticizes coal further lessening coal porosity and permeability [76]. In the enhanced coal bed methane (ECBM) technique, higher CO2 injection for enhanced methane recovery may cause coal to shrink, ultimately affecting permeability. Also, the sorption capacity of coal is reduced from applied stress [77]. In addition, CO2 is highly soluble in water as compared to methane, which may lead to pore water acidification, mineral dissolution, eventually causing coal failure [78]. 7.2.5 Conventional/Prediction Models for CO2 Sequestration Numerous modelling studies in literature report geological CO2 sequestration by predicting the favourable conditions of CO2 storage under conditions mimicking 126 A. N. Rehman and B. Lal a reservoir environment. Such kind of prediction analysis facilitate the understanding of the feasibility of CO2 sequestration process without having to perform lengthy experiments in the lab. In this regard, this section briefly describes the prediction studies carried out on CO2 sequestration in sediments. Kinetic growth model of CO2 hydrate in porous media with promoter has been proposed by Palodkar et al. [79]. Herein, the model was based on four assumptions and the chemical potential difference between the liquid and hydrate phase was considered as the driving force. Further, the kinetic model was developed considering CO2 consumption rate dependence on the chemical potential difference of the liquid and hydrate phase and the reaction rate taking place on the surface of sediment particles. Based on the modifications, the final form of the equation proposed by Palodkar et al. [79] representing the kinetic growth model for CO2 hydrate formation in porous sediment is shown below ⎧ [ ) ]⎫ ( ) n C O2 α −ΔE a β ( H L 1 − ex p −n H K 0 ex p A μw − μw t (7.1) = n H2 O,T nH RT RT They further estimated the driving force by adopting Holder et al. [80] approach through estimating the chemical potential at operating temperature and pressure and also estimated effective surface area of the porous media. Furthermore, they evaluated the proposed kinetic model by comparing with two other models- the Avrami [81] and Lee et al. [82] models. They selected data sets for four different porous media systems including, cellulose foam, silica gel, silica sand and polyurethane foam in a fixed bed reactor with varying gas feed involving pure CO2 and mixtures of CO2 H2 and CO2 -H2 -C3 H8 . The findings reveal improved performance of the proposed kinetic model in predicting the experimental data as compared to the existing models of Avrami [81] and Lee et al. [82]. Prediction studies have been carried out regarding CO2 sequestration in saline aquifers through reservoir simulation. Generally, CO2 has been successfully sequestered in aquifers at shallow water depth as supercritical CO2 . However, a hydrate stability zone (HSZ) exists at water depth larger than 630 m in tropical regions, where it extends below the seafloor. In this zone CO2 and water can exist as solid CO2 hydrate. Kai Zhang et al. [83] investigated the feasibility of storing CO2 inside the hydrate stable zone (HSZ) by reservoir pressure management by maintaining the CO2 hydrate formation pressure using water producers and CO2 injectors. They conducted numerical simulations to evaluate CO2 storage in three aquifers in tropical waters and then compared the three confined aquifers. CMG STARS simulation software was used to build the three aquifer models. The porosity, permeability and thickness of the considered aquifer varied from 30%, 3000 md and 50 m, respectively. The first aquifer is considered a shallow one without a HSZ with a water depth of 800 m and buried depth of 830 mbsf. For the second aquifer, it is considered at a water depth of 800 m and buried depth of 70 mbsf with 60% outside and 40% inside the HSZ, while the third and last aquifer resides inside HSZ with a water depth 7 Machine Learning in CO2 Sequestration 127 of 800 m and buried depth of 30 mbsf. Four corner wells acting as CO2 injectors or water producers manage the reservoir pressure during the simulation. For the first aquifer, the results showed that by reducing the reservoir pressure to below the fracture pressure through water production, it is possible to store up to 6% PV or 61 Mt of CO2 . CO2 breakthrough in water producers and the amount of water produced affects the amount of CO2 stored. However, in case of second and third aquifer the results revealed that by reducing the reservoir pressure to below the fracture pressure through water production, up to 12% PV or 164 Mt and 21% PV and 13 Mt of CO2 can be stored, respectively. Finally, the findings show that during CO2 injection, CO2 hydrate formation slows CO2 breakthrough and moderates reservoir pressure due to volume shrinkage thus allowing more CO2 to be stored. Another benefit is the solid form of CO2 storage as hydrate which minimizes the probability of CO2 migration and leakage post CO2 injection through the caprock. CO2 injection into porous reservoir has been studied by Singh et al. [84] to predict geological CO2 sequestration. They also reported an additional simulation of CO2 injection in a depleted methane hydrate reservoir. In their study they mainly focused on four parameters to analyse the response of the reservoir to storage of CO2 . These parameters include reservoir porosity, initial water saturation and reservoir temperature and injection pressure. In addition, the main quantities of interest were the pattern of hydrate formation and the cumulative mass of CO2 sequestration in the reservoir as a function of time. They considered a transient, non-isothermal, and multiphase model which involves three phases- gaseous, aqueous and CO2 -hydrate and three components- water, CO2, and CO2 -hydrate. Water and CO2 forms the mobile phase while hydrate is the immobile phase. Results obtained from the numerical simulation reveal that the initial water saturation is a significant parameter affecting both CO2 gas migration and hydrate formation. However, the results from isothermal simulation are almost similar to nonisothermal model. Overall, the simulation results conclude slow reaction kinetics with less amount of CO2 stored as hydrate, however, with time the capacity increases. 7.3 Machine Learning in CO2 Sequestration Machine learning in CCUS (CO2 capture, utilization, and storage) technologies is expanding knowledge through advancement. Especially in CO2 sequestration, the application of machine learning is growing in areas such as predicting leakage during CO2 injection and monitoring the flow of CO2 within the reservoir where there exists a large number of variables that needs to be considered. These applications are helpful in reducing the experimental time that would otherwise take long to achieve. The successful application of machine learning in predicting the reservoir conditions for CO2 sequestration could benefit from such applications through reducing time as well as cost from experiments. The following section briefly describes the machine learning based CO2 sequestration techniques. 128 A. N. Rehman and B. Lal 7.3.1 Machine Learning in Enhanced Oil Recovery (EOR) EOR assisted CO2 sequestration via machine learning is developing rapidly in sectors of oil and gas production. Recent studies demonstrate a lot of prediction analysis that could estimate the flow of gas, CO2 leakage and trapping efficiency of CO2 during injection process. Table 7.1 shows a brief summary of the EOR-CO2 sequestration studies in the literature. • Case Study I To ensure a good performance of both project profit and CO2 storage, optimization of EOR project with multiple objectives are required. You et al. [85] estimated the CO2 storage and production performance through optimizing field scale numerical Table 7.1 Summary of machine-learning based EOR-CO2 sequestration studies Author Algorithm Brief description You et al. [85] Hybridized machine learning A new framework to co-optimize field performance and CO2 storage by merging hybridized machine learning algorithms for reduced order modeling and optimization techniques You et al. [86] Artificial Neural Network (ANN)/ MOPSO In this study a stable computational framework combining artificial neural network (ANN) and multi-objective optimizers was proposed to optimize CO2 -EOR processes VoThanh et al. [87] Artificial Neural Network (ANN) This study predicted the oil recovery and CO2 storage capacity in Residual Oil Zones (ROZs) using ANN application You et al. [88] Artificial Neural Network (ANN) and Particle Swarm Optimization This work reports a computational workflow using machine learning to optimize a CO2 -WAG project that considers both hydrocarbon recovery and CO2 sequestration efficacies Balch et al. [89] Deep learning Developing and validating technologies for safely and permanently storing CO2 and ensuring storage permanence. Further, improve reservoir storage efficiency and support predictability of CO2 storage capacity in geologic formations Kashkooli et al. [90] Coupled optimization CCS-EOR problem was tackled by utilizing dynamic well flow settings as optimization variables and improve the efficiency through a sensitivity analysis 7 Machine Learning in CO2 Sequestration 129 compositional simulations in the Pennsylvanian Upper Morrow sandstone reservoir in the Farnsworth Unit (FWU), Ochiltree County, Texas. In this project, they developed an improved framework combining hybridized machine learning algorithms for reduced order modeling and optimization techniques to co-optimize field performance and CO2 storage. The model’s framework incorporates geological, geophysical, and engineering data. The model was calibrated with the performance history of an active CO2 flood data to attain a successful history matched model. Further, uncertain parameters such as reservoir rock properties and relative permeability exponents were adjusted to incorporate potential changes in wettability in the history matched model. Furthermore, a proxy model was generated with hybridized multilayer and radial basis function (RBF) neural network methods. Then a series of training and calibration runs were conducted in the proxy model to make it reliable and robust until it reached the specified criteria for validation. After the proxy model validation, hybrid evolutionary and machine learning optimization algorithms were used to obtain an optimum solution. The uncertain variables considered in the modelling study for the optimization process includes gas oil ratio, production rates, water alternating cycle, bottom hole pressure of producer and injectors. Overall, 160 optimization experiments were performed with the PSO evolutionary algorithm to obtain the optimum combinations of control variables [85]. On comparison, it was observed that the optimal case showed a slightly smaller project NPV and almost the same cumulative oil production as compared to the baseline case. However, the CO2 storage of optimal case was 18.08% higher than that of baseline case, which finally resulted in a 9% higher overall objective function for optimal case. This study confirms the possibility of developing robust and reliable machine learning optimization algorithm that could optimize a developmental strategy to maximize oil production and storage of CO2 within the FWU. As a result, it will serve as a baseline for future field-scale compositional modeling and reactive transport for CO2 -EOR initiatives all over the world. CO2 -EOR combined processes involve oil recovery with simultaneous storage of CO2 . In such processes, to optimise the oil recovery to maximum with efficient CO2 storage volume and also optimise the cost simultaneously, a stable computational framework was designed by You et al. [86]. This framework operates by combining artificial neural network (ANN) with multi-objective optimizers to optimise the entire process. For this, expert ANN systems were trained and employed as surrogate models of the high-fidelity compositional simulator during the optimization. Further, a synthetic injection pattern-base case study was conducted to confirm the robustness of the development optimization protocol. Then, a field implementation in MorrowB formation to optimize the tertiary recovery stage of the field is presented [86]. Furthermore, a comparison is made of the optimum solution and the optimization findings provide valuable insight into the decision-making process of CO2 -EOR project when multiple objective functions are considered. They show that there are 130 A. N. Rehman and B. Lal potential multi-solutions satisfying certain criteria in a CO2 -EOR project designing, which otherwise cannot be found using traditional weighted sum method. In this study, Thanh et al. [87] predicted the oil recovery and CO2 storage capacity through artificial neural network during CO2 injection process. The training database was created by incorporating uncertainty parameters, such as geological factors and well operations. The cumulative oil production, cumulative CO2 storage, and cumulative CO2 retained simulations were then developed using a total of 351 numerical samples. When compared to objective values, the findings showed that the developed ANN model had an exceptional prediction ability with a high correlation coefficient (R2) of over 0.98 and a total root mean square error of less than 2%. Five real ROZs in the Permian Basin were used to test the accuracy and stability of ANN models. It was concluded in the results that the ANN model could accurately predict the CO2 storage and oil recovery, and that it could be used as a reliable tool to examine the viability of CCUS in ROZs at an early stage. Finally, CO2 -EOR storage projects were used to evaluate the potential use of the proposed ANN model. • Case Study II This study is on an ongoing CO2 -EOR project in Farnsworth Unit (Texas, US) [88]. Here, a CO2 -WAG project is optimized using a machine learning assisted computational approach that considers both hydrocarbon recovery and CO2 sequestration efficacies. The fluid flow dynamics of the on-going CO2 - EOR project is investigated using a compositional field-scale numerical simulation model. Time-series project responses such as hydrocarbon production, CO2 storage and reservoir pressure data are predicted using artificial-neural-network (ANN) based proxy models. The proxy model outputs are used to not only evaluate the objective function but also to restrict the optimization processes physically and economically. To optimize the required objective function, the proposed optimization workflow combines the Particle Swarm Optimization (PSO) algorithm with the ANN proxies. The findings show that the proposed workflow is a more reliable approach for co-optimizing CO2 -EOR projects. According to the findings, the optimised case could store roughly 94% of the purchased CO2 within Farnsworth Unit. When compared to the baseline scenario, the observed optimal case has a 21.69% increase in CO2 storage and 8.74% increase in oil output. The developed co-optimization approach for CO2 sequestration and oil recovery was highly successful providing 8.74% greater project NPV and 19.79% higher overall objective function value. Further studies related to CO2 -EOR projects are in the form of coupled optimization that offers simultaneous path for both CO2 sequestration and oil production to solve the time consuming issue associated with carbon capture and storage-enhanced oil recovery (CCS-EOR) applications. The objective of such studies is to be able to conduct the entire process of oil recovery and CO2 storage within a stipulated time frame. Dynamic well flow parameters were used to solve the CCS-EOR issue. The optimization variables in this case were the bottom-hole pressure and the flow rate were with a weighted objective function [90]. 7 Machine Learning in CO2 Sequestration 131 An optimization model referred as EC was used for the case study. The model is in the form of a dynamic partial differential equation (PDE) restricted problem having a nonlinear, nonconvex, and non-smooth nature. In order to simplify the analysis, the solution method was divided into two stages- predicting the production and updating the BHPs correspondingly. For the prediction analysis a compositional commercial numerical flow simulator (ECLIPSE 300, version 2018) is utilised while for the BHPs a serial optimization algorithm is used. Due to the nonlinear nature of the problem, a combination series of genetic algorithms (GA) and pattern search algorithm (PS) were used to avoid trapping in local minima. • Case Study III In this case study the validity of the EC model is tested on real 3-D with three phase heterogeneous carbonate oil reservoir. This reservoir consists of 32 × 28 × 12 anisotropic grid blocks with inhomogeneous sizes. The reservoir is under CO2 injection process and is located in the south side of Iran and has three producing and two injecting wells in the reservoir. A compositional simulator is used to model oil production. The initial reservoir model parameters include initial reservoir pressure, bubble point pressure, reservoir temperature, oil viscosity, formation water viscosity, average porosity, average permeability, maximum water cut and maximum GOR. Herein EOR and CO2 storage is designed for a time frame of 20 years with low flow rate profiles. For unbiased comparison initially a base scenario is defined, and its objective value is compared with those of the optimized scenarios [90]. The optimized case was shown to improve the objective value and gas storage efficiency by 2.86% and 12.1%, respectively, in the optimal scenario. The findings can be utilized to investigate a number of operational matters such as the CO2 distribution map in the reservoir, and the well settings. 7.3.2 Machine Learning in Saline Aquifers Machine learning based prediction for CO2 sequestration in saline aquifers is helpful in ensuring safe deposition of CO2 for an extended period. There are recent studies that report the application of machine learning algorithms to determine the feasibility of CO2 sequestration process in saline aquifers. Table 7.2 presents the summary of the reported studies in literature for CO2 sequestration in saline aquifers using machine learning. CO2 sequestration in geological sediments is associated with several uncertain parameters that call for risk management approaches to monitor the safety of the stored CO2 in marine sediments. However, prior proceeding with any such risk assessment approach, there are certain factors that needs to be considered like the location of the monitoring well and the type of input parameters to be measured considering the uncertainties at the geologic sequestration sites. In view of this, a filtering-based data assimilation procedure was developed by Chen et al. [91] to effectively monitor 132 A. N. Rehman and B. Lal Table 7.2 Summary of machine-learning for CO2 sequestration in saline aquifers Author Algorithm Brief description Chen et al. [91] Multivariate adaptive regression splines Designing effective monitoring systems for CO2 leakage using a filtering-based data assimilation procedure. Machine learning was employed to lower the computing cost of the filtering-based data assimilation process Song et al. [92] Artificial Neural Network (ANN) The ANN model was effectively used to solve and predict trapping mechanisms as well as optimize interactions between physical parameters such as formation and storage efficiency Tang et al. [93] Deep learning This study reports a deep-learning-based surrogate model to treat coupled flow and geomechanics in carbon storage operations Thanh and Lee [94] Gaussian process regression (GPR), Support vector machine (SVM), and Random forest (RF) This study predicts CO2 trapping efficiency in saline aquifers using 3 machine learning models De-Gald et al. [95] RBF Neural Network and CMG STARS software This work models CO2 storage as hydrate in saline aquifers using STARS software the process with minimum cost using Multivariate Adaptive Regression Splines algorithm. The algorithm employs physics based simulation results of CO2 injection and subsequent multiphase flow in saline aquifers to generate efficient reduced order models. For the validation of the workflow it was compared to both a simple validation case as well as a complex case involving multiple monitoring wells. The findings revealed successful application of the proposed method in building effective monitoring strategies considering uncertainties. Further, when various forms of monitoring signals are used simultaneously, the outcome is observed to be better with reduced uncertainty levels as compared single signal type. Song et al. [92] used a machine learning approach to predict the efficiency of CO2 sequestration in sediments. They further tested the practical application of geological CO2 sequestration through several case studies using artificial neural network (ANN) involving geologic, petrophysical, and reservoir characteristics. The ANN based CO2 sequestration model was constructed for saline aquifers. The input data for the testing of the model was developed from a synthetic aquifer using residual and solubility trapping data. Machine learning algorithm Python coupled with Keras was used for the training and testing of the model. The estimated coefficient of determination (R2) and root mean square error (RMSE) values were used to determine the best iteration and regression. The model is made up of 8 hidden layers, each of which 7 Machine Learning in CO2 Sequestration 133 has 64 nodes and has an R2 of 0.9847 and an RMSE of 0.0082. In order to test for practical applications, the model was validated using a saline aquifer field model in Korea. The model was found to predict with high accuracy resulting in an R2 of 0.9933 and an RMSE of 0.0197 for RTI and an R2 of 0.9442 and an RMSE of 0.0113 for STI. The model was highly successful in predicting CO2 trapping efficiency in a huge number of case studies, and optimize correlations between physical formation parameters and storage efficiency. Hence, this model could be a viable alternative, where conventional simulations fail to provide successful solutions. Tang et al. [93] developed a deep-learning-based surrogate model capable of predicting flow and geomechanical responses in CO2 storage operations. The 3D recurrent R-U-Net model combines deep convolutional and recurrent neural networks to capture the spatial distribution and temporal evolution of saturation, pressure and surface displacement fields. The method is trained using high-fidelity simulation results for 2000 storage-aquifer realizations characterized by multi-Gaussian porosity and log-permeability fields. These numerical solutions are expensive because the domain that must be considered for the coupled problem includes not only the storage aquifer but also a surrounding region, overburden and bedrock. The surrogate model is trained to predict the 3D CO2 saturation and pressure fields in the storage aquifer, and 2D displacement maps at the Earth’s surface. Detailed comparisons between surrogate model and full-order simulation results for new (test-case) storage-aquifer realizations show that the saturation, pressure and surface displacement fields provided by the surrogate model display a high degree of accuracy, both for individual test-case realizations and for ensemble statistics. Finally, the recurrent R-U-Net surrogate model is applied with a rejection sampling procedure for data assimilation. Although the observations consist of only a small number of surface displacement measurements, significant uncertainty reduction in pressure buildup at the top of the storage aquifer (caprock) is achieved. Geological carbon storage (GCS) has been practiced in deep saline formations for decades by trapping CO2 within the aquifers. In view of this, it is significant to evaluate the efficiency of CO2 trapping during the process of CO2 storage. Hence the need arises to develop efficient means that could estimate CO2 trapping efficiency accurately to achieve high carbon storage capacity in saline aquifers. Machine learning has proved meaningful in this area and has been used by Thanh and Lee [94] to predict CO2 trapping efficiency in saline formations. They employed three machine learning algorithms namely, Gaussian process regression (GPR), support vector machine (SVM), and random forest (RF) for the prediction. For this initially, they created a training dataset by incorporating data for various uncertainty variables such as the reservoir petrophysical properties, physical characteristics, and geological parameters and performed about 101 reservoir simulations. Trapping efficiency was then evaluated by considering the residual trapping, solubility trapping, and cumulative CO2 injection data obtained from the simulation runs. Their findings revealed that the three mentioned algorithms (GPR, SVM and RF) proved highly successful in predicting CO2 trapping efficiency in deep saline aquifers with the GPR model obtaining the highest correlation factor (R2 = 0.992) and lowest root mean square error (RMSE = 0.00491) among the three models. Further, the accuracy of the GPR 134 A. N. Rehman and B. Lal models was tested for a real reservoir in offshore Vietnam and the results indicated a good agreement between the two. This suggested the success of GPR machine learning models in predicting the CO2 trapping efficiency in saline aquifers. However, most of the studies related to machine learning mainly focus on the detection of leakage while CO2 injection and its flow behavior within the reservoir. Hydrate related studies using machine learning are quite rare when it comes to CO2 hydrate storage in sediments. De-Gald et al. [95] evaluated the storage capacity of CO2 in saline aquifers in the hydrate form using machine learning algorithms. The hydrate form of storage is advantageous over other CO2 storage methods since it involves storing CO2 in the solid form. Hence the possibility of CO2 leakage through migration is less. However, it is highly important to ensure the feasibility of the hydrate method for practical applicability. Several studies focus on the experimental approach through lab scale testing to test the feasibility which certainly provides meaningful insights but is quite time consuming involving lengthy experiments. Machine learning plays an important role where multiple simulation runs can be conducted through different algorithms within a short span of time. Such a study employing machine learning algorithms and reservoir simulation software were conducted to evaluate the sensitivity of reservoir parameters to facilitate the understanding of the specific reservoir characteristics impacting the stability of CO2 hydrate storage [95]. Here, Hydra Flash software was used to calculate the hydrate formation curve considering it as a reference. Further, CO2 hydrate storage in aquifers was modelled using CMG STARS simulation software. They considered fluid flow, formation and decomposition reactions and heat transfer including water, gaseous CO2 , and solid CO2 hydrate to simulate the developed reservoir model. The simulations were assumed to be on an isotropic and homogeneous infinite aquifer. The formation and decomposition reaction equations considered for the simulation model are shown below 7.7H2 O + C O2 = C O2 (H yd) (7.2) H2 O + C O2 (H yd) = 7.7H2 O + C O2 (7.3) They applied Sobol Analysis and Effect Estimates in their model due to their high prediction accuracy. The Radial Basis Function (RBF) Neural Network was used as a model. The simplest form of the RBF network is a three-layered feedforward neural network. All the simulations were performed using CMG CMOST to estimate the factors affecting the hydrate formation over a period of 10 years. The factors considered include the effects of porosity, sea depth, permeability, thermal conductivity, and heat capacity. The findings suggested that within the studied range the rate of CO2 hydrate formation varied linearly or quadratically with respect to porosity, permeability, injection temperature, the thermal conductivity of the rocks, volumetric heat capacity and reference pressure or sea depth. Injection temperature and rock conductivity showed negligible effect on hydrate formation while a moderate effect was observed in the case of permeability considering the range studied. The rate of 7 Machine Learning in CO2 Sequestration 135 hydrate formation was highly sensitive to varying porosity, heat capacity and reference pressure. They finally concluded that CO2 storage as hydrate in saline aquifers for an extended period largely depends on several reservoir characteristics that need special consideration before its practical implementation. 7.3.3 Machine Learning in Depleted Reservoirs The use of machine learning techniques in the area of depleted reservoirs is still new and there is not much literature available on it. However, few studies report the use of machine learning based applications in CO2 sequestration in these reservoirs. The major advantage of using machine learning is the ability to perform a huge number of simulations within a short time. Thus, time management is very essential as such analysis involves thousands of runs. Machine learning and artificial intelligence was employed by Amini and Mohaghegh [96] through developing a proxy fluid model to test for a real case CO2 sequestration project. The primary objective of the model was to evaluate the uncertain reservoir parameters during the CO2 injection process. These parameters include saturation, pressure, and CO2 mole fraction in the reservoir. The major advantage of the data-driven model compared to the numerical reservoir simulation model lies in its ability to generate saturation, pressure, and CO2 mole fraction data through the entire reservoir within a short time with significantly less computational effort. In their study, they successfully managed to fasten the process for a specific case by about 20 times using this proxy model which took around fifteen minutes for a single simulation run and about 45 s to apply for all monthly time steps. This shows that an artificial intelligence based proxy model could be used to model a significantly non-linear system. The ability of neural networks to recognize patterns allows the model to capture the interaction between numerous system parameters without any kind of interference. Machine learning in carbon sequestration finds its best use in detecting leakage during carbon capture and storage applications. Automatic leakage detection during CO2 injection in reservoirs was studied using machine learning models by Sinha et al. [97]. In the model they used simple harmonic pulse testing (HPT) to measure data for the pressure and the rate of CO2 injection. Harmonic pulse testing data from a field study in the Cranfield oil field, Mississippi, USA was used to validate the feasibility of the machine learning model by incorporating baseline parameters and an artificially introduced leak in the model. The reservoir leakage problem is detected by assuming it is an anomaly detection problem with deviations from the predicted behavior indicating reservoir leaks. The results indicate that different machine learning algorithms used in this study such as multi-layer feed-forward network, Long Short-Term Memory, and convolutional neural network prove successful in identifying leakages which could prevent great loss during CO2 storage applications. 136 A. N. Rehman and B. Lal 7.4 Conclusion Machine learning techniques are useful in multiple ways including leak detection, migration and monitoring flow behavior in the reservoir during CO2 injection. These types of predictions are beneficial to know the feasibility of the entire process and also the risk associated with it. Thus, it helps to reduce the time for thousands of simulation runs and also makes complex problems easy and quick. The future application of machine learning in areas that involve large and complex simulations will help generate quick responses within short time. References 1. Xi-liu YUE, Qing-xian GAO (2019) ScienceDirect contributions of natural systems and human activity to greenhouse gas emissions. Adv Clim Chang Res 9:243–252 2. Turley C, Blackford J, Widdicombe S, Lowe D, Nightingale P (2006) Reviewing the impact of increased atmospheric CO2 on oceanic pH and the marine ecosystem key words: marine acidification ecosystem reviewing the impact of increased atmospheric CO2 on oceanic pH and the marine ecosystem. Science (80)44:2–6 3. Oh BK, Choi SW, Park HS (2017) Influence of variations in CO2 emission data upon environmental impact of building construction. J Clean Prod 140:1194–1203 4. Babu P, Linga P, Kumar R, Englezos P (2015) A review of the hydrate based gas separation (HBGS) process for carbon dioxide pre-combustion capture. Energy 85:261–279 5. Sims REH, Rogner HH, Gregory K (2003) Carbon emission and mitigation cost comparisons between fossil fuel, nuclear and renewable energy resources for electricity generation. Energy Policy 31:1315–1326 6. Ma ZW, Zhang P, Bao HS, Deng S (2016) Review of fundamental properties of CO2 hydrates and CO2 capture and separation using hydration method. Renew Sustain Energy Rev 53:1273– 1302 7. Mukherjee A, Okolie JA, Abdelrasoul A, Niu C, Dalai AK (2019) Review of post-combustion carbon dioxide capture technologies using activated carbon. J Environ Sci (China) 83:46–63 8. Bond T, Venkataraman C, Masera O (2004) Global atmospheric impacts of residential fuels. Energy Sustain Dev 8:20–32 9. IPCC (2018) Proposed outline of the special report in 2018 on the impacts of global warming of 1.5 °C above pre-industrial levels and related global greenhouse gas emission pathways, in the context of strengthening the global response to the threat of climate cha. Ipcc Sr 15(2):17–20 10. Aminu MD, Nabavi SA, Rochelle CA, Manovic V (2017) A review of developments in carbon dioxide storage. Appl Energy 208:1389–1419 11. Rubin ES (2006) IPCC special report on Carbon dioxide capture and storage structure of the intergovernmental panel on climate change (IPCC) 12. Bachu S (2015) Review of CO2 storage efficiency in deep saline aquifers. Int J Greenh Gas Control 40:188–202 13. Jia W, McPherson BJ, Pan F, Xiao T, Bromhal G (2016) Probabilistic analysis of CO2 storage mechanisms in a CO2 -EOR field using polynomial chaos expansion. Int J Greenh Gas Control 51:218–229 14. Ampomah W, Balch RS, Grigg RB, McPherson B, Will RA, Lee S, Dai Z, Pan F (2017) Cooptimization of CO2 -EOR and storage processes in mature oil reservoirs. Greenh Gases Sci Technol 7:128–142 15. Bachu S, Shaw J (2003) Evaluation of the CO sequestration capacity in Alberta’s oil and gas reservoirs at depletion and the effect of underlying aquifers. J Can Pet Technol 42 7 Machine Learning in CO2 Sequestration 137 16. Qi R, LaForce TC, Blunt MJ (2008) Design of carbon dioxide storage in oil fields. SPE Annu Tech Conf Exhib 17. Trivedi JJ, Babadagli T (2009) Oil recovery and sequestration potential of naturally fractured reservoirs during CO2 injection. Energy Fuels 23:4025–4036 18. Gorecki CD, Hamling JA, Ensrud J, Steadman EN, Harju JA (2012) Integrating CO2 EOR and CO2 storage in the bell creek oil field. Carbon Manag Technol Conf 19. Saini D, Jimenez I (2014) Evaluation of CO2 -EOR and storage potential in mature oil reservoirs. SPE West North Am Rocky Mt Jt Meet 20. Wang H, Liao X, Dou X, Shang B, Ye H, Zhao D, Liao C, Chen X (2014) Potential evaluation of CO2 sequestration and enhanced oil recovery of low permeability reservoir in the Junggar Basin, China. Energy Fuels 28:3281–3291 21. Zhao X, Liao X (2012) Evaluation method of CO2 sequestration and enhanced oil recovery in an oil reservoir, as applied to the Changqing Oilfields, China. Energy Fuels 26:5350–5354 22. Goodman A, Hakala A, Bromhal G, Deel D, Rodosta T, Frailey S, Small M, Allen D, Romanov V, Fazio J (2011) US DOE methodology for the development of geologic storage potential for carbon dioxide at the national and regional scale. Int J Greenh Gas Control 5:952–965 23. Grigg R (2002) Long-term CO2 storage using petroleum industry experience. Carbon Dioxide Capture Storage Deep Geol Form 2:853–865 24. Bachu S (2016) Identification of oil reservoirs suitable for CO2 -EOR and CO2 storage (CCUS) using reserves databases, with application to Alberta, Canada. Int J Greenh Gas Control 44:152– 165 25. Han WS, McPherson BJ, Lichtner PC, Wang FP (2010) Evaluation of trapping mechanisms in geologic CO2 sequestration: case study of SACROC northern platform, A 35-year CO2 injection site. Am J Sci 310:282–324 26. Peck WD, Azzolina NA, Ge J, Bosshart NW, Burton-Kelly ME, Gorecki CD, Gorz AJ, Ayash SC, Nakles DV, Melzer LS (2018) Quantifying CO2 storage efficiency factors in hydrocarbon reservoirs: a detailed look at CO2 enhanced oil recovery. Int J Greenh Gas Control 69:41–51 27. Zhao X, Rui Z, Liao X (2016) Case studies on the CO2 storage and EOR in heterogeneous, highly water-saturated, and extra-low permeability Chinese reservoirs. J Nat Gas Sci Eng 29:275–283 28. Farajzadeh R, Eftekhari AA, Dafnomilis G, Lake LW, Bruining J (2020) On the sustainability of CO2 storage through CO2 —Enhanced oil recovery. Appl Energy 261:114467 29. Foroozesh J, Jamiolahmady M, Sohrabi M (2016) Mathematical modeling of carbonated water injection for EOR and CO2 storage with a focus on mass transfer kinetics. Fuel 174:325–332 30. Pham V, Halland E (2017) Perspective of CO2 for storage and enhanced oil recovery (EOR) in Norwegian North Sea. Energy Procedia 114:7042–7046 31. Ampomah W, Balch R, Cather M, Rose-Coss D, Dai Z, Heath J, Dewers T, Mozley P (2016) Evaluation of CO2 storage mechanisms in CO2 enhanced oil recovery sites: application to morrow sandstone reservoir. Energy Fuels 30:8545–8555 32. Patel K, Shah M, Sircar A (2018) Plasma pulse technology: an uprising EOR technique. Pet Res 3:180–188 33. Menad NA, Noureddine Z, Hemmati-Sarapardeh A, Shamshirband S, Mosavi A, Chau K (2019) Modeling temperature dependency of oil-water relative permeability in thermal enhanced oil recovery processes using group method of data handling and gene expression programming. Eng Appl Comput Fluid Mech 13:724–743 34. Buscheck T, Bielicki J, White J (2016) Geologic CO2 storage using pre-injection brine production in tandem reservoirs : a strategy for improved storage performance and enhanced water recovery. CO2 Summit II Technol Oppor 35. Ettehadtavakkol A, Lake LW, Bryant SL (2014) CO2 -EOR and storage design optimization. Int J Greenh Gas Control 25:79–92 36. Rubin ES, Keith DW, Gilboy CF (2005) Greenhouse Gas Control Technologies. In: Rubin ES, Keith DW, Gilboy CF, Wilson M, Morris T, Gale J, Thambimuthu KBT-GGCT 7 (eds) Proceedings 7th international conference Greenh. Gas Control Technol. 5–9 Sept. 2004, Vancouver, Canada, 1st Editio. Elsevier Science Ltd, Oxford, p 2700 138 A. N. Rehman and B. Lal 37. van der Meer B (2005) Carbon dioxide storage in natural gas reservoirs. Oil Gas Sci Technol 60:527–536 38. Hildenbrand A, Schlömer S, Krooss BM (2002) Gas breakthrough experiments on fine-grained sedimentary rocks. Geofluids 2:3–23 39. Li Z, Dong M, Li S, Huang S (2006) CO2 sequestration in depleted oil and gas reservoirscaprock characterization and storage capacity. Energy Convers Manag 47:1372–1382 40. Lei H, Zhang Q, Li X (2019) Preliminary numerical modeling of CO2 geological storage in the huangcaoxia gas reservoir in the Eastern Sichuan Basin, China. Geofluids. https://doi.org/ 10.1155/2019/9545723 41. Clarke AL, Imber J, Davies RJ, Van Hunen J, Daniels SE, Yielding G (2017) Application of material balance methods to CO2 storage capacity estimation within selected depleted gas reservoirs. Pet Geosci 23:339–352 42. Agartan E, Gaddipati M, Yip Y, Savage B, Ozgen C (2018) CO2 storage in depleted oil and gas fields in the Gulf of Mexico. Int J Greenh Gas Control 72:38–48 43. Raza A, Gholami R, Rezaee R, Rasouli V, Bhatti AA, Bing CH (2018) Suitability of depleted gas reservoirs for geological CO2 storage: a simulation study. Greenh Gases Sci Technol 8:876–897 44. Myshakin EM, Singh H, Sanguinito S, Bromhal G, Goodman AL (2018) Numerical estimations of storage efficiency for the prospective CO2 storage resource of shales. Int J Greenh Gas Control 76:24–31 45. Bender S, Akin S (2017) Compositional simulation of CO2 storage in a CO2 flooded carbonate reservoir. Soc Pet Eng—SPE Symp Prod Enhanc Cost Optim 2017. https://doi.org/10.2118/ 189257-ms 46. Hannis S, Lu J, Chadwick A, Hovorka S, Kirk K, Romanak K, Pearce J (2017) CO2 storage in depleted or depleting oil and gas fields: what can we learn from existing projects? Energy Procedia 114:5680–5690 47. Loizzo M, Lecampion B, Bérard T, Harichandran A, Jammes L (2010) Reusing o&g-depleted reservoirs for CO2 storage: pros and cons. SPE Proj Facil Constr 5:166–172 48. Celia MA, Bachu S, Nordbotten JM, Bandilla KW (2015) Status of CO2 storage in deep saline aquifers with emphasis on modeling approaches and practical simulations. Water Resour Res 51:6846–6892 49. Grobe M, Pashin J, Dodge R (2010) Carbon dioxide sequestration in geological media—State of the science. In: AAPG studied geology 59, p 59 50. Bachu S, Adams JJ (2003) Sequestration of CO2 in geological media in response to climate change: capacity of deep saline aquifers to sequester CO2 in solution. Energy Convers Manag 44:3151–3175 51. Junin R, Abang Hasbollah D (2016) CO2 storage capacity assessment of deep saline aquifers in Malaysia. 18Th Int Conf Oil Reserv Prod 18:1374–1383 52. Zhou Q, Birkholzer JT, Tsang C-F, Rutqvist J (2008) A method for quick assessment of CO2 storage capacity in closed and semi-closed saline formations. Int J Greenh Gas Control 2:626– 639 53. Cavanagh AJ, Haszeldine RS (2014) The Sleipner storage site: capillary flow modeling of a layered CO2 plume requires fractured shale barriers within the Utsira Formation. Int J Greenh Gas Control 21:101–112 54. Jiang X (2011) A review of physical modelling and numerical simulation of long-term geological storage of CO2 . Appl Energy 88:3557–3566 55. Li B, Benson SM, Tchelepi HA (2012) Modeling fine-scale capillary heterogeneity in multiphase flow of CO2 and brine in sedimentary rocks. Proc. XIX Int. Conf. Water Resour. University of Illinois at Urbana-Champaign, IL, USA, pp 17–22 56. Knopf S, May F (2017) Comparing methods for the estimation of CO2 storage capacity in saline aquifers in germany: regional aquifer based vs. structural trap based assessments. Energy Procedia 114:4710–4721 57. Cui G, Wang Y, Rui Z, Chen B, Ren S, Zhang L (2018) Assessing the combined influence of fluid-rock interactions on reservoir properties and injectivity during CO2 storage in saline aquifers. Energy 155:281–296 7 Machine Learning in CO2 Sequestration 139 58. Jin C, Liu L, Li Y, Zeng R (2017) Capacity assessment of CO2 storage in deep saline aquifers by mineral trapping and the implications for Songliao Basin, Northeast China. Energy Sci Eng 5:81–89 59. Ajayi T, Gomes JS, Bera A (2019) A review of CO2 storage in geological formations emphasizing modeling, monitoring and capacity estimation approaches. Pet Sci.https://doi.org/10. 1007/s12182-019-0340-8 60. Hesse MA, Tchelepi HA, Orr FM (2006) Scaling analysis of the migration of CO2 in saline aquifers. Proc SPE Annu Tech Conf Exhib 5:3001–3012 61. Fang Y, Baojun B, Dazhen T, Dunn-Norman S, Wronkiewicz D (2010) Characteristics of CO2 sequestration in saline aquifers. Pet Sci 7:83–92 62. Brandt AR, Heath GA, Kort EA, et al (2014) Methane leaks from North American natural gas systems. Science (80)343:733–735 63. Busch A, Gensterblum Y (2011) CBM and CO2 -ECBM related sorption processes in coal: a review. Int J Coal Geol 87:49–71 64. Mukherjee M, Misra S (2018) A review of experimental research on enhanced coal bed methane (ECBM) recovery via CO2 sequestration. Earth-Science Rev 179:392–410 65. Pan Z, Ye J, Zhou F, Tan Y, Connell LD, Fan J (2018) CO2 storage in coal to enhance coalbed methane recovery: a review of field experiments in China. Int Geol Rev 60:754–776 66. He Q, Mohaghegh SD, Gholami V (2013) A Field study on simulation of CO2 injection and ECBM production and prediction of CO2 storage capacity in unmineable coal seam. J Pet Eng 2013:803706 67. Battistutta E, van Hemert P, Lutynski M, Bruining H, Wolf KH (2010) Swelling and sorption experiments on methane, nitrogen and carbon dioxide on dry Selar Cornish coal. Int J Coal Geol 84:39–48 68. Ibrahim AF, Nasr-El-Din HA (2015) A comprehensive model to history match and predict gas/water production from coal seams. Int J Coal Geol 146:79–90 69. Ibrahim AF, Nasr-El-Din HA (2015) CO2 sequestration in unmineable coal seams. Soc Pet Eng—SPE/IATMI Asia Pacific Oil Gas Conf Exhib APOGCE 2015. https://doi.org/10.2118/ 176458-ms 70. Reeves SR, Davis DW, Oudinot AY (2004) A technical and economic sensitivity study of enhanced coalbed methane recovery and carbon sequestration in coal advanced resources international, Inc . 9801 Westheimer , Suite 805 Houston , Texas 77042 U . S . Department of Energy DE-FC26–00NT40924. Energy 71. Zhiming F, Xiaochun L (2012) Experimental study of gas adsorption-induced coal swelling and its influence on permeability. Disaster Adv 5:769–773 72. Mazumder S, Wolf KH (2008) Differential swelling and permeability change of coal in response to CO2 injection for ECBM. Int J Coal Geol 74:123–138 73. Romanov V, Soong Y (2008) Long-term CO2 sorption on upper freeport coal powder and lumps. Energy Fuels 22:1167–1169 74. Romanov VN, Goodman AL, Larsen JW (2006) Errors in CO2 adsorption measurements caused by coal swelling. Energy Fuels 20:415–416 75. Congress US (2007) Energy independence and security act. Public Law 110–140:1492–1801 76. Corum MD, Jones KB, Warwick PD (2013) CO2 sequestration potential of unmineable coalstate of knowledge. Energy Procedia 37:5134–5140 77. Hol S, Peach C, Spiers C (2011) Applied stress reduces the CO2 sorption capacity of coal. Int J Coal Geol. https://doi.org/10.1016/j.coal.2010.10.010 78. Bustin RM, Cui X, Chikatamarla L (2008) Impacts of volumetric strain on CO2 sequestration in coals and enhanced CH4 recovery. Am Assoc Pet Geol Bull 92:15–29 79. Palodkar AV, Mandal S, Jana AK (2016) Modeling growth kinetics of gas hydrate in porous media: experimental validation. Energy Fuels 30:7656–7665 80. Holder GD, Corbin G, Papadopoulos KD (1980) Thermodynamic and molecular properties of gas hydrates from mixtures containing methane, Argon, and Krypton. Ind Eng Chem Fundam 19:282–286 81. Avrami M (1939) Kinetics of phase change. I: General theory. J Chem Phys 7:1103–1112 140 A. N. Rehman and B. Lal 82. Lee JW, Chun MK, Lee KM, Kim YJ, Lee H (2002) Phase equilibria and kinetic behavior of CO2 hydrate in electrolyte and porous media solutions: Application to ocean sequestration of CO2 . Korean J Chem Eng 19:673–678 83. Zhang K, Lau HC (2022) Sequestering CO2 as CO2 hydrate in an offshore saline aquifer by reservoir pressure management. Energy 239:122231 84. Singh RP, Shekhawat KS, Das MK, Muralidhar K (2020) Geological sequestration of CO2 in a water-bearing reservoir in hydrate-forming conditions. Oil Gas Sci Technol Rev d’IFP Energies Nouv 75:51 85. You J, Ampomah W, Kutsienyo EJ, Sun Q, Balch RS, Aggrey WN, Cather M (2019) Assessment of enhanced oil recovery and CO2 storage capacity using machine learning and optimization framework. Soc Pet Eng—SPE Eur Featur 81st EAGE Conf Exhib 2019. https://doi.org/10. 2118/195490-ms 86. You J, Ampomah W, Sun Q (2020) Development and application of a machine learning based multi-objective optimization workflow for CO2 -EOR projects. Fuel 264:116758 87. Vo Thanh H, Sugai Y, Sasaki K (2020) Application of artificial neural network for predicting the performance of CO2 enhanced oil recovery and storage in residual oil zones. Sci Rep 10:1–16 88. You J, Ampomah W, Sun Q, Kutsienyo EJ, Balch RS, Dai Z, Cather M, Zhang X (2020) Machine learning based co-optimization of carbon dioxide sequestration and oil recovery in CO2 -EOR project. J Clean Prod 260:120866 89. Balch R, McPherson B, Will RA, Ampomah W (2021) Recent developments in modeling: farnsworth texas, CO2 EOR Carbon Sequestration Project. SSRN Electron J 1–11 90. Kashkooli SB, Gandomkar A, Riazi M, Tavallali MS (2021) Coupled optimization of carbon dioxide sequestration and CO2 enhanced oil recovery. J Pet Sci Eng 109257 91. Chen B, Harp DR, Lin Y, Keating EH, Pawar RJ (2018) Geologic CO2 sequestration monitoring design: a machine learning and uncertainty quantification based approach. Appl Energy 225:332–345 92. Song Y, Sung W, Jang Y, Jung W (2020) Application of an artificial neural network in predicting the effectiveness of trapping mechanisms on CO2 sequestration in saline aquifers. Int J Greenh Gas Control 98:103042 93. Tang M, Ju X, Durlofsky LJ (2021) Deep-learning-based coupled flow-geomechanics surrogate model for CO2 sequestration, 1–44 94. Vo Thanh H, Lee K-K (2021) Application of machine learning to predict CO2 trapping performance in deep saline aquifers. Energy, 122457 95. De-Gald V, Rahmanian N, Batrshin D (2021) Assessment of CO2 storage as hydrates in Saline Aquifers using machine learning algorithms. Chem Eng Trans 86:517–522 96. Amini S, Mohaghegh S (2019) Application of machine learning and artificial intelligence in proxy modeling for fluid flow in porous media. Fluids 4:1–17 97. Sinha S, de Lima RP, Lin Y, Sun AY, Symons N, Pawar R, Guthrie G (2020) Normal or abnormal? Machine learning for the leakage detection in carbon sequestration projects using pressure field data. Int J Greenh Gas Control 103:103189 Chapter 8 Machine Learning in Wax Deposition Ihtisham Ul Haq and Bhajan Lal Abstract One of the biggest sectors providing energy demands is the oil and gas industry. Ensuring a continuous fuel supply necessitates flow assurance. Flow assurance is challenging and crucial for subsea pipelines since the seawater temperature, as well as the encircling temperature, is typically much colder than the exterior atmospheric temperature. Wax deposition takes place when the inner pipe temperature drops below the crude oil cloud temperature. Such challenges emerge when the paraffins in crude oil crystallise and accumulate on the cold upstream wall. The primary issue affecting flow assurance or decreasing the efficiency of oil and gas transportation is wax deposition. Consequently, this chapter provides an insight into methodologies for reducing and monitoring wax accumulation. In addition, the numerical models for wax deposition are highlighted. In the final section, the role of artificial intelligence (machine learning) in the efficacious prediction of wax or the enhancement of various numerical models is affirmed. Keywords Machine learning · Wax accumulation · Flow assurance · Numerical models · Artificial intelligence 8.1 Introduction Flow assurance is very significant for the profitable and valid manufacturing of the oil and gas industry in the Deepwater atmosphere. It may be summed up as “the process to manage the secure delivery of fluid flow from the reservoirs to the focal point effectively [1]”. Fossil fuel is a great energy resource currently and will be continued in forthcoming years. The vast quantities of oil and gas found in the deep ocean have piqued the interest of those interested in utilising and utilising offshore oil I. U. Haq · B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_8 141 142 I. U. Haq and B. Lal resources. Because of high production costs and a hostile environment, it is difficult to obtain oil and gas reserves in deep water and arctic regions [2]. The major concern of flow assurance during the manufacturing of oil and gas, especially in deep water projects, is the managing of various solid accumulations, for instance, gas hydrates, waxing, asphaltenes, corrosion, erosion, and slugging [3]. That may cause capital losses in terms of production facilities, which lead to pipeline blockages as the solid deposits can interact with each other and therefore in flow assurance failure [4]. Flow assurance is not only concerned with the hydrocarbon flow path, although it is applied to every segment of production involving, selection, inspection, and repair of process issues. As the number off wells expanding in deep water sea, it is supposed to be essential to make less the severe threats due to solid deposition and its difficult recovery [5]. To accomplish the safe and economical process, the only possible solution is to understand the causes of tragedies, primary flow assurance challenges, and the development of reduction plaining, which plays a vital role and gives a victorious perfection in term of, operation of wells [6]. Flow assurance does play an important role, both technically and economically. The challenges become more sever and the expenditure goes up as moving to the deep-water activities, as the seabed temperature is normally between 273.15 k–1094 k and at 1500–3000 dept which is favourable temperature for gas hydrate formation, wax deposition, and chances of slugging [7–10]. The rock-hard deposited in the fossil fuel manufacturing industry may be mitigated through mechanical, chemical, and heating processes or a combination of them [11]. If solid deposits is not mitigated early, it will be a massive impediment in the transportation of hydrocarbons because a deposit layer will grow up swiftly and impede the follow as a result, severe blockage in pipeline [5, 12]. The reduction techniques are the most important industrially, as the development of oil and gas operations are carried on at a hug deepness and worst atmosphere, which leads to enormous issues faced by industry [13]. To minimise the serious threat which leading the oil and gas company to spend billions of dollars every year, it is imperative to handle the critical situation before it causes a big catastrophe and financial loss from the production interruption or asset damage. There are various techniques that are used to control these challenges, which are faced by the oil and gas industry during manufacturing and delivering of hydrocarbons in the worst weather conditions, where high pressure and low temperature are involved. these methods are to be applied through mechanically, thermodynamically, and chemically, but in fact, the most feasible way among all the given techniques suggested for the reduction of existence and unseen problems is to use the chemical inhibitors. however, it is not the permanent solution but somehow it can show better performance. The most critical flow assurance issues, which are essential to be contemplated for the manufacturing of multiple flows, are slugging, waxing, corrosion, erosion, emulsion, asphaltenes, naphthenates, scale, and lastly, gas hydrates. Multiphase flow means the combined flow of gas, oil and water in pipelines elevated in the offshore and onshore oil and gas industry. 8 Machine Learning in Wax Deposition 143 8.1.1 Wax Deposition in Oil and Gas Industry Wax is a class of hydrocarbon that are natural components of any crude oil and most gas condensate. Waxy deposition in oil industry can create problems during production and transportation, and it is observed one of the most severe flow assurances issues in oil and gas field all around the world, mainly within the manufacturing of onshore and offshore field. The enough solid Wax depositions can be taken place, by the time the waxy oil constituents in crude oil can be deposited approximately 4–6 wt.% in the pipelines. Usually, two sorts of wax are encountered, when it comes to categorizing of wax: (1) microcrystalline wax, that may add to bottom tank sludge, and (2) macrocrystalline that may elicit as massive flow assurance challenges during manufacturing and conveying of crude oil. Paraffine wax would be initially solidify or crystalize or encourage out of raw petroleum before the accumulation of paraffine wax taken place. The deposition of paraffine wax happens by two phases, as known as nucleation and crustal growth [1]. Most of the time, the raw petroleum viscosity may augment as the soon as the deposition of wax take place. Despite of the fact that the sticky wax is not happened to wall of pipe [14]. The formation of the wax deposited layer will be enlarged during the hydrocarbon production and with passage of time it can block the flow of pipeline completely, as can be seen in Fig. 8.1, which indicates discontinuation of fluid flow in term of production, it can also exhibit the expelling of wax plug [2]. In addition, the wax formation directs to some substantive failure such as decrease in permeability as well as formation damage closed the wellbore, modifications of source fluid arrangement, its rheology because of the phase separation since wax solid precipitates, and also constraining effect on functioning ability of the whole framework [15]. Fig. 8.1 Expelling of wax by pigging technique [4] 144 I. U. Haq and B. Lal There are few elements which affected Wax participation for instance, stream rate, induced temperature drops. Temperature of tubular side wall, unrefined petroleum temperature, sharing stress and crude oil or raw petroleum design or composition. As wax deposition is renowned for massive flow assurance defiance within the production system of the oil and gas industry. It may be diminished or reverted either by chemical, mechanical or heating technique or through a collection of few of them but the chemical techniques is the foremost better among. In case the given techniques are not effective meant that they cannot be able to hindrances wax deposition, subsequently a layer of wax will be developed. To avoid the accumulation of wax there are some methodologies are being employed. 8.2 Wax Deposition Mitigation Techniques Wax formation in undersea pipes is a remarkable financial concern in oil and gas fields. The formation of wax occurs when the crude oil is passed by a deep-sea transmission line where the temperature of crude oil drops below its cloud point temperature, or “wax appearance temperature)” As the wax accumulates on the wall of the cold pipe, it causes a severe flow assurance [5]. Under the worst scenario, production must have been halted and the clogged pipeline which need to be replaced. The repair and interruption expenditures are anticipated to be $30 million per event. Wax deposits were so extensive and frequent in one case that a North Sea offshore platform had to be abandoned at a cost of approximately $100,000,000. Therefore, the need for remediation approaches has been considered an important aspect of the flow assurance study [6]. Pigging is one of the conventional mechanical approaches for wax deposition removal in which an observation gauge, or “pig,” is inserted into the piping system to scrape off the wax. Although, if the deposition of wax develops quickly and solidifies, the use of pig may get stuck in the pipe, as it has happened in a pipeline in the Gulf of Mexico [7]. Another strategy is the insertion of chemicals (an exothermic reaction with regulated temperature to avoid heat emission and take advantage of fusion chemical processes). There are some common approaches that have been utilized for wax deposition removal, such as mechanical, heating, chemical inhibitors, and microbiological, which are detailed in the following segments [9]. 8.2.1 Mechanical Techniques The mechanical method is the conventional way of being applied by industry for wax accumulation elimination. In this technique, scrappers are employed in the tube as well as a “pig” utilization inside the pipeline. The mechanical method is the conventional way of being applied by industry for wax accumulation elimination [8]. In this technique, scrappers are employed in the tube as well as a “pig” utilization 8 Machine Learning in Wax Deposition 145 Fig. 8.2 The pigging process for wax deposition removal inside the pipeline. The walls of the tube are scrapped by scrappers, and the wax is removed as the well is operating [11]. The transmission line check-up gauge “pig” instrument is one of the most conventional techniques, having been in operation by the industry for almost a century as shown in Fig. 8.2. These two wax treatment strategies are under repair and maintenance, but they have drawbacks such as perforation clogging inside the well during scraping and the pigging device being trapped inside due to wax. In comparison to other ways, all mechanical methods are cost-effective [8]. 8.2.2 Heating Heating approaches are mainly applied to keep the temperature of crude oil constant to reduce wax formation. The most prevalent ways are surface coating, insulating the pipeline, and warm watering, etc. The hot water or hot oil at 65–105 °C is supplied into the transmission line by a pump which melts the accumulated wax [12]. The wax is inhibited from forming against the wall by adding solid resin particles with a melting point greater than WAT in the oil to facilitate slurry flow. The wax is inhibited by using a surface layer of thermal insulation material such as plastic to hide a reduction in crude oil temperature. All these ways are applicable, but they are highly exorbitant [9, 13]. 146 I. U. Haq and B. Lal 8.2.3 Chemical Inhibitors Chemical approaches entail the addition of chemical inhibitors to the oil to suppress wax development. Dispersants, detergents, and wax crystal modifiers are the three types of chemical wax inhibitors. The dispersants and detergents are surface activators that keep the wax particles dispersed and suspended, inhibiting them from sticking to each other, tube walls, or other solid surfaces. The surface activation chemicals improve the pipe’s solid surface, decreasing shear and wax particle contact on the transmission line’s wall. Various kinds of surfactant alter solubility by dissolving the nuclei and preventing wax particle agglomeration [16]. Wax crystal enhancers are commonly referred to as “pour point depressors” since they let oil stream at low temperature while maintaining its density and under certain scenarios [17]. Wax crystal stabilizers possess the identical geometry as wax molecules and coprecipitate by scooping the wax particle’s crystalline structure and producing hydrocarbon linkages [1]. In this way, they obstruct the formation of wax crystals by restricting the potential of wax crystals to create three dimensional structures. Each of the wax inhibitors is efficient. Although they need to be employed once the bulk temperature of the hydrocarbon exceeds it wax appearance temperature (WAT) [6, 18]. 8.2.4 Microbiological techniques The use of microbes to cope with wax is uncommon, although it has been proven to be efficient in a number of field studies. The activity of enteric bacteria involves the production of bioactive compounds that are considered useful as wax suppressors. When treating crude oil samples, bacterial strains including Actinomyces species have demonstrated destruction of ligand-binding hydrocarbon components (from C15 to C20 ) [8]. The bacterial treatment has also been observed to enhance crude oil, reducing the wax appearance temperature of crude oil. Consequently, the crude oil is lower vulnerable to wax deposition. The adoption of a microbial technology is novel, but it might be employed in wells to maintain a static culture. The wax mitigation techniques encompassing mechanical, heating, chemical inhibitors, and microbial processes are discussed prior to being applied to eliminate and treat deposited wax within the transportation line [11]. At the moment, both computing and intelligent systems are required to determine the wax formation and its preventative management. 8 Machine Learning in Wax Deposition 147 8.3 Prediction’s Models in Wax Deposition The computational modelling technique that is commonly used to track and predict wax development through direct numerical approximation or by software with a backend mathematical model is Some of the most essential wax deposition models from open literature are addressed in the chapter alongside their corresponding equations. The development of wax deposition models is considered on the basis of assumptions and parameter choices. In this section, the discussion is based on four different models. The equilibrium model (EM), the Matzain’s model (MM), the film mass transfer model (FMTM), and Venkatesan’s model (VM) are all described [19]. The EM is based on thermodynamic equilibrium and takes into account the concentration gradient in the model. MM is an adapted version of EM that incorporates the diffusion equation as an empirical relationship along with shear stripping and trapped oil components to make it more effective. The FMTM is established on mass and heat transfer The ANIFS model contains five layers, as seen in Fig. 8.5, and the equations describing the model’s output are listed below. The if/then rule is used to apply the first fuzzy logic [20–22]. The coefficients are primarily considered in the development of the VM, as is the measurement of mass flux in the model. Due to its agreement with experimental results, the applicability of MM has been proven to be the most self-sufficient of the four models. In addition, it is owing to the model’s consideration of oil capture and the linkage of the shear stripping influence. 8.4 Machine Learning in Wax Deposition The oil and natural gas industry’s research and development is moving to toward the use of artificial intelligence (AI) algorithms and machine learning ideas. Depending on the operating scenarios, equipping systems with AI can improve their decisionmaking capabilities. The algorithms that are generally utilized include evolutionary algorithms (EA), artificial neural networks (ANN), swarm intelligence (SI), and fuzzy logic (FL) [20]. If required, the use of one or more artificial intelligent algorithms can be applicable. The Adaptive Neural Fuzzy Inference System (ANFIS) gave insights about the finest condensation proportions utilizing ANN, and also the NFL evaluation assisted in the prolonged enhancement of the wax deposition model. The application of the statistical model took into account the wax accumulation dependent and independent variables among the recent research [6, 23]. The viscosity of the crude oil is the dependent factor, and pressure is the independent factor. The linear boundary limits could be maintained by plotting a pressure/viscosity versus pressure plot (as can be seen in Fig. 8.3), and if the actual plot exceeds the specified limit, it indicates a high possibility of wax deposition. The ANN model was created using a backpropagation neural network (BNN). BNN employs two loops, one forward and one reverse. The forward loop facilitates the processing of data from inputs to outputs, 148 I. U. Haq and B. Lal considering that the backward loop reverses the process from output to input. The reverse loop processes the data and applies weight error checking to it before passing it to the forward loop. The backpropagation algorithm is trained in this manner through the ongoing operation of forward-to-backward and backward-to-forward loops. Because of the adjusting weights contained within the neural network, BNN is, however, referred to as a training algorithm. The most concise modelling can be seen in the work of [17], which used an ANN mathematical model to predict the probability of wax accumulation. Upon noticing experimentally that the deposition rate of wax was nonlinear, the Kolmogorov theorem was adapted; it virtually emulates a nonlinear function into a linear function by employing a two-layer ANN with a predefined error Fig. 8.3 The potential prediction of wax development [23] 8 Machine Learning in Wax Deposition 149 limit. Figure 8.4 depicts the mapping framework for making predictions on the wax deposition rate. Wax accumulation proportion is the output parameter of the input parameters (viscosity, shear stress, temperature gradient, and concentration gradient). When the results were compared to the calculated set, the linear regression model had a correlation of 0.78, while the ANN model had a correlation of 0.97. The ANFIS model was applied to the prediction of the accumulated layer of wax in the presence of single-phase turbulent fluid [24]. A five-layered ANFIS model with input parameters such as wax concentration (%), Reynolds number, time, temperature-driven force, and temperatures (outside, inside, and pipe wall) was considered (the ratio of the gradient temperature wall and the outside temperature to the bulk temperature of the hydrocarbons). The ANIFS model contains five layers, as seen in Fig. 8.5, and the equations describing the model’s output are listed below. The if/then rule is used to apply the first fuzzy logic. The ANIFS model contains five layers, as seen in Fig. 8.5, and the equations describing the model’s output are listed below. The if/then rule is used to apply the first fuzzy logic. This model’s prediction of wax accumulated thickness was found to be very close to experimental values. The mean square error values in comparison to experimental data were 3-digit reliability (0.00077034) and a higher predictive Fig. 8.4 The ANN model’s structure for predicting the rate of wax accumulation [17] Fig. 8.5 The ANFIS model’s structure for predicting the rate of wax accumulation [17] 150 I. U. Haq and B. Lal value (0.9858). On the other hand, Amar et al. [25] has used robust machine learning methods very recently to predict wax accumulation under large production circumstances. to accomplish this, 88 experiments measurements were applied to train a multilayer perceptron (MLP) optimised with the Levenberg–Marquardt algorithm (MLP-LMA) and the Bayesian Regularization algorithm (MLP-BR). The findings demonstrates that MLP-LMA performed much better, with an as a whole root mean square error of 0.2198 and a regression coefficient (R2) of 0.9971. MLP-LMA outperforms preceding techniques in the literature, according to the comparison of results. Yu et al. [26], have employed Radial Basis Function and support vector machines for wax development rate in the transmission line. The outcomes indicate that the errors of the two techniques are within the acceptable range. Because support vector machines can determine and model finite samples, it has been discovered that their accuracy is higher. To conclude that, Different researchers have implied different techniques, but the best way or approach to predict the wax deposition is to use the machine learning. 8.5 Wax Deposition Case Studies The oil is transported from offshore platform to the onshore via a 30- inch, 203-km transmission line for in India’s offshore field to the west of India. As the crude oil is transported, it has a high wax content and a 30 °C pour point. Typically, the seabed temperature is 22 °C. A pour point depressant (PPD) is infused. Notably, 300 ppm to 350 ppm PPD is added to achieve a pour point of 18 °C or 21 °C and thus keep the oil flowing. The Deepwater transmission lines are pigged on a regular basis [27]. The PPD infusion on its own ends up costing $15 million annually. While the consumption of PPD has managed to keep the oil flowing, an increment in upstream pressure has been noticed over time. It thus identifies the existence of wax deposits in the pipeline’s Deepwater. A technological survey reported that approximately 20,000 m3 of wax has been accumulated in the pipeline (as it has a volume of 90,226 m3 ). To reduce wax formation, hence the frequency of pigging, a combination of PPD and dispersant was taken into account [28]. Another case study is the Gannet oil field, which is situated roughly 180 kms east of Aberdeen in the United Kingdom at a depth of around 90 m. The Gannet field can be found 16 kms northeast of the Gannet Alpha platform. Risers 31 and 32 transport Gannet oil. This oil’s wax appearance temperature is generally 35.5 °C. Wax accumulation in Gannet’s subsea pipeline has been approximated to be about 21 m3 of wax, developed over an 8 km distance. A suitable substance was chosen and transfused at a speed of 0.6 m/min. An extra 480 m3 /day of hydrocarbons can be managed to recover after chemical inoculation. In addition, the pigging technique has been used frequently in conjunction with inhibitors to prevent wax deposition in the Gannet oil field [27–29]. Production began in 2008 at the Power Play oil field, which is situated in 706 m of water in the Garden Banks block 28 of the Gulf of Mexico. It is a Deepwater tieback to a network facility that includes a Deepwater Sea 8 Machine Learning in Wax Deposition 151 flow loop for oil circulation and pigging. Two 10 km 4.5'' (pipe in piping system) PIP pipeline pigging loop systems with enclosed steel catenary risers comprise the subsea architecture. The oil’s wax appearance temperature is 41.1 °C, and the pour point varies from −5 °C to 19 °C. Wax build-up is conceivable due to the high WAT [27]. To reduce or eliminate the risk, a PIP platform was being used to dissipate heat from the oil. An exponential increase in the flowing downhole pressure and a fall in the oil supply rate, as noticed in the northern and southern pipeline systems during oil production, mentioned the possibility of temporary plugging due to wax formation in the piping system. To inhibit blockage, xylene substances have been inoculated into the transmission lines at rates ranging from 0.04 to 0.32m3 /min. This, coupled with an increase in pressure, was inadequate to discard the wax build-up [30]. On the contrary, Russian oil production is almost entirely onshore and plagued by wax formation, as evidenced by the Mukhanovskoe oil field, the Padovskoe oil field, the Petrukhnovskoe oil field, and the Urmanskoe oilfield. To obtain the maximum effectiveness in attempting to control wax deposition in transmission lines, technological approaches including thermal coating and pigging were used in accordance with chemical inhibitors. Surfactants (nanylphenol, synthol), aromatic solvents (benzene, xylene, toluene), surfactants (nanylphenol, synthanol), and aliphatic alcohols (butano, pentanol, hexanol) have been utilised as chemical inhibitors to mitigate wax formation [31]. The incidence of wax deposition problems takes place in high-temperature environments. For instance, the Kirkuk-Ceyhan crude oil channel between Iraq and Turkey is an example of an onshore pipe system with wax formation during the cold season. The aromatic solvents and pigging approach were utilised to lower wax deposition in the tubing. The typical low temperature in winter between northern Iraq and Turkey is about 2 °C, which is sufficient to produce and deposit wax within the pipes. The Kirkuk-Ceyhan crude oil tube has a diameter of 40 inches and a distance of 1049 kms, 986 km of which cross through the Turkish region, with a volume of 700,000 barrels per day. The wax mole fraction moves up with a value of 0.193 about 300 miles from the nearest inlet and reaches 0.2225 at the pipeline’s end [32]. 8.6 Conclusion In summary, this chapter examines the application of various industrially pertinent techniques and studies to monitor and predict wax accumulation. furthermore, the discussion has made on the process and models used for wax deposition, as a theoretical basis. According to recent literature, the role of machine learning in accurate and suitable prediction of wax deposition is mentioned. Therefore, the application of machine learning can ensure the prediction of wax deposition and help the wax deposition models to integrate oil sample knowledge on a consistent premise to confirm that wax forecasting is credible. 152 I. U. Haq and B. Lal References 1. Ragunathan T, Husin H, Wood CD (2020) Wax formation mechanisms, wax chemical inhibitors and factors affecting chemical inhibition. Appl Sci 10:1–18 2. Bern PA, Withers VR, Cairns RJR, Petroleum B (1980) European offshore conference & exhibition 3. Alf Tordal (2006) Pigging of pipelines with high wax content by Alf Tordal, Statoil ASA, Stavanger, Norway. PPSA Aberdeen Semin, 1–6 4. Akpabio MG (2013) Cold flow in long-distance subsea pipelines. Ntnu 5. Merino-Garcia D, Correra S (2008) Cold flow: a review of a technology to avoid wax deposition. Pet Sci Technol 26:446–459 6. Alnaimat F, Ziauddin M, Mathew B (2020) Wax deposition in crude oil transport lines and wax estimation methods. Intell Syst Comput. https://doi.org/10.5772/intechopen.89459 7. Li W, Huang Q, Wang W, Gao X (2020) Advances and future challenges of wax removal in pipeline pigging operations on crude oil transportation systems. Energy Technol. https://doi. org/10.1002/ente.201901412 8. White M, Pierce K, Acharya T (2018) A review of wax-formation/mitigation technologies in the petroleum industry. SPE Prod Oper 33:476–485 9. Sousa AL, Matos HA, Guerreiro LP (2019) Preventing and removing wax deposition inside vertical wells: a review. J Pet Explor Prod Technol 9:2091–2107 10. Tabaaza GA, Haq IU, Zain DB, Lal B (2021) Toxicological issues of conventional gas hydrate inhibitors. Process Saf Prog, 1–6 11. Shafquet A, Ismail I, Japper-Jaafar A, Sulaiman SA, Chala GT (2015) Estimation of gas void formation in statically cooled waxy crude oil using online capacitance measurement. Int J Multiph Flow 75:257–266 12. Bell E, Lu Y, Daraboina N, Sarica C (2021) Experimental investigation of active heating in removal of wax deposits. J Pet Sci Eng 200:108346 13. Bidmus HO, Mehrotra AK (2004) Heat-transfer analogy for wax deposition from paraffinic mixtures. Ind Eng Chem Res 43:791–803 14. Struchkov IA, Rogachev MK (2017) Wax precipitation in multicomponent hydrocarbon system. J Pet Explor Prod Technol 7:543–553 15. Zhu T, Walker J a, Liang J, Laboratory PD (2008) Evaluation of wax deposition and its control during production of Alaska North slope oils. https://doi.org/10.2172/963363 16. Lashkarbolooki M, Esmaeilzadeh F, Mowla D (2011) Mitigation of wax deposition by waxcrystal modifier for Kermanshah crude oil. J Dispers Sci Technol 32:975–985 17. Chi Y, Daraboina N, Sarica C (2017) Effect of the flow field on the wax deposition and performance of wax inhibitors: cold finger and flow loop testing. Energy Fuels 31:4915–4924 18. Al-Yaari M (2013) Paraffin wax deposition: mitigation & removal techniques. Soc Pet Eng Saudi Arab Sect Young Prof Tech Symp 2011:35–44 19. Panacharoensawad E, Sarica C (2013) Experimental study of single-phase and two-phase water-in-crude-oil dispersed flow wax deposition in a mini pilot-scale flow loop. Energy Fuels 27:5036–5053 20. Depeursinge A, Racoceanu D, Iavindrasana J, Cohen G, Platon A, Poletti P-A, Muller H (2010) Fusing visual and clinical information for lung tissue classification in HRCT Data. Artif Intell Med 229:ARTMED1118 21. Giacchetta G, Marchetti B, Leporini M, Terenzi A, Dall’Acqua D, Capece L, Cocci Grifoni R (2019) Pipeline wax deposition modeling: a sensitivity study on two commercial software. Petroleum 5:206–213 22. Singh P, Venkatesan R, Fogler HS, Nagarajan N (2000) Formation and aging of incipient thin film wax-oil gels. AIChE J 46:1059–1074 23. Obanijesu EO, Omidiora EO (2008) Artificial neural network’s prediction of wax deposition potential of Nigerian crude oil for pipeline safety. Pet Sci Technol 26:1977–1991 24. Jalalnezhad MJ, Kamali V (2016) Development of an intelligent model for wax deposition in oil pipeline. J Pet Explor Prod Technol 6:129–133 8 Machine Learning in Wax Deposition 153 25. Nait Amar M, Jahanbani Ghahfarokhi A, Shang Wui Ng C (2021) Predicting wax deposition using robust machine learning techniques. Petroleum. https://doi.org/10.1016/j.petlm.2021. 07.005 26. Yu Z, Ruoyu W, Xue W (2021) Prediction method of wax deposition rate in crude Oil pipeline based on RBF Neural network and support vector machine. E3S Web Conf 271:04007 27. Theyab MA, Yahya SY (2018) Introduction to wax deposition. Int J Petrochemistry Res 2:126– 131 28. Kang PS, Lee DG, Lim JS (2014) Status of wax mitigation technologies in offshore oil production. Proc Int Offshore Polar Eng Conf 3:31–38 29. Craddock HA, Mutch K, Sowerby K, McGregor S, Cook J, Strachan C (2007) A case study in the removal of deposited wax from a major subsea flowline system in the gannet field. Proc SPE Int Symp Oilf Chem 55–60 30. Theyab MA (2020) A review of wax mitigation methods through hydrocarbon production. J Pet Env Biotechnol 11:412 31. Struchkov IA, Rogachev MK, Kalinin ES, Pavlov PV, Roschin PV (2018) Laboratory investigation of organic-scale prevention in a Russian oil field. SPE Prod Oper 33:113–120 32. Kok M, Onder S (2007) Mathematical modelling of wax deposition in crude oil pipeline systems. https://doi.org/10.2523/64514-ms Chapter 9 Machine Learning Application in Gas Hydrates Ali Qasim and Bhajan Lal Abstract The issue of gas hydrates is one of the major concerns in flow assurance industry. In order to study the gas hydrates theroretically, reserachers have developed different thermodynamic and kinetic models to predict the hydrate formation parameters. The use of machine learning in gas hydrate inhibition prediction and analysis has become a well-established field of study as computational capability has increased in recent years. In the literature, both supervised and unsupervised learning methods have been applied to predict the gas hydrate parameters. This chapter has discussed the conventional modeling approaches in gas hydrate parameters prediction and the use of machine learning techniques in this field of study. Four different case studies involving the use of machine learning in gas hydrates prediction have also been presented. Keywords Machine learning · Flow assurance · Hydrates · Modelling 9.1 Introduction to Gas Hydrates In 1810, Sir Humphry Davy discovered gas hydrates or also known as clathrate hydrates. Gas hydrates are solid crystalline inclusion compounds made up of polyhedral water holes (the host) and small gas molecules (the guest) physically trapped within them [1–4]. Gas hydrates form when water and non-polar low molecular weight gases or volatile liquids are exposed to low temperatures ranging from 275 to 285 K and high pressures ranging from 2.0 to 10.0 Mpa [5–10]. Encaged guest molecules use Van der Waals interactions to stabilise hydrogen-bonded water molecules in gas hydrate forms. Methane (CH4 ), ethane (C2 H6 ), carbon dioxide (CO2 ), propane (C3 H8 ), hydrogen sulphide (H2 S), iso-butane (i-C4 H10 ), and n-butane A. Qasim · B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_9 155 156 A. Qasim and B. Lal Fig. 9.1 a Structure I, b Structure II, c Structure H (n-C4 H10 ) are all hydrate forming gases [11–13]. The formation of hydrates in natural gas field deep-water pipes poses a serious environmental risk and may threaten employees in the exploration and transmission sectors [8, 14–17]. As a result, risk management for gas hydrates is becoming increasingly crucial. Gas hydrates are not entirely harmful in and of themselves because they are useful in a range of applications such as fuel delivery, storage, and separation techniques. Massive amounts of natural gas hydrates can be discovered at marine continental margins and permafrost zones, making gas hydrates a potential future fuel resource [1, 18, 19]. However, gas hydrates have so far presented more problems than commercially viable solutions. Natural gas hydrates can be divided into three categories depending on their crystal structures: cubic structure I (sI), cubic structure II (sII), and hexagonal structure (sH) [20–23]. Guest molecules with diameters ranging from 4.2 to 6, such as CH4 , C2 H6 , CO2 , and H2 S, are defined as belonging to Structure 1 [24, 25]. The diameter of Structure II hydrate is estimated to be less than 4.2. Structure II is made up of N2 , H2 , C3 H8 , and C4 H10 as single guests [26, 27]. Figure 9.1a–c represent the hydrate structure categories I, II, and H, respectively. According to the literature, hydrate equilibrium and structure play a significant role in cavity occupancy of guest molecules. Because the equilibrium conditions are determined by the guest molecule, structure I and II hydrates require just one guest molecule, whereas structure H requires at least two different guest molecules. It should be noted that both CH4 and CO2 produce sI hydrates under the high pressure and low temperature conditions found in oil and gas transmission lines [28–30]. 9.2 Introduction to Gas Hydrates Gas hydrates found their application in varying fields at industrial or environmental level and can be utililized according to different research interests. They may include methane recovery, energy storage, desalination, greenhouse gas capture and flow assurance. The details of these categories are provided and discussed in the subsequent sections. 9 Machine Learning Application in Gas Hydrates 157 9.2.1 Methane Recovery Natural gas hydrates can be found beneath Arctic permafrost as well as beneath the ocean floor. Because there are substantial deposits of hydrates available, gas hydrates could be a potential source of natural gas in the near future. When a cubic metre of gas hydrate is lifted to the earth’s surface, it creates 164 cubic metres of natural gas, the majority of which is CH4 . The organic carbon content contained in the world’s gas hydrates, according to the US Geological Survey, exceeds that of coal, oil, and other types of natural gas combined. The naturally occurring gas hydrate resource is estimated to be worth 10,000 trillion cubic feet to more than 100,000 trillion cubic feet [31, 32]. Currently, identified gas hydrate reserves in permafrost areas around the world are expected to be more than twice as vast as all other known hydrocarbon reserves combined. Natural gas hydrate resources are estimated to be more than 1.5 × 1016 m3 , and even if only 15–17 mol percent of methane is gathered from these sources, it can supply energy for at least 200 years [1, 33, 34]. To increase methane recovery from natural gas hydrate sources, techniques including depressurization and heat stimulation with thermodynamic and kinetic inhibitors are commonly used [35, 36]. 9.2.2 Energy Storage Natural gas can be found in a variety of locations around the world. As a result, the transportation of natural gas from one location to another is typically accomplished by long-distance gas transmission lines. Liquefied natural gas (LNG) carrier ships, which demand massive capital and operating costs, are typically utilised for longdistance transportation. Gas hydrates, which are more stable than LNG, can be created and stored at greater temperatures [37]. Furthermore, because hydrates have a self-preservation proclivity that permits them to maintain stability even at atmospheric pressures, the utilisation of hydrate technology for gas storage and transportation may be investigated. Numerous studies suggest that storing gases in hydrate structures has significant potential as a storage medium for a wide range of gases [18, 38]. Gas hydrates could be used for hydrogen or natural gas storage and transportation, as well as excellent cooling storage media in air conditioning systems [39, 40]. When compared to cryogenic applications, keeping gases in hydrate form is far safer [41]. 9.2.3 Desalination A desalination system based on gas hydrates has been offered as a potential alternative to reverse osmosis and typical multi-flash distillation procedures. The hydrate 158 A. Qasim and B. Lal production method removes all salts, ions, and other impurities from the hydrate crystalline structure since the hydrate structure consists only of guest gases and hosting water molecules. According to recent studies, hydrate-based desalination has the potential to produce cheaper desalinated water than current technologies [42, 43]. 9.2.4 Greenhouse Gas Capture One of the most difficult challenges in the gas industry is the separation of acidic pollutants such as carbon dioxide (CO2 ) and hydrogen sulphide (H2 S) [44, 45]. To solve this, the gas industry frequently employs amine-based absorption procedures. Commercial solvent costs and regeneration have an impact on the industry’s operating expenses (Opex). Because gas hydrate formation is mostly solvent-free, the concept of acidic gas removal via gas hydrates is extremely appealing. favourable conditions of low temperature and high pressure. To accelerate the formation of hydrates, a trace amount of chemicals such as hydrate promoters can be introduced to water [46–49]. The hydrate-based separation is based on HLVE, which states that different gases have different demands for equilibrium [12, 50]. CO2 and H2 S are both captureable in hydrate form and require low pressure to make gas hydrates. Furthermore, gas hydrate is used in the CO2 gas capture in the flue gas stream [7]. 9.3 Conventional Gas Hydrate Mitigation Method Gas hydrate development in the gas transmission line can be avoided using a range of common processes, including depressurization, heating, dehydration, and chemical additives, each with its own set of benefits and drawbacks [2, 51]. Depressurization is a corrective method that reduces pressure on one side of the transmission line and is typically used after hydrate plug growth has commenced. In the case of long and high-pressure gas transmission pipes, however, the line-depressurization technique is impracticable [13]. However, it is one of the most expensive preventative methods, costing over $1 million USD per kilometre of pipeline length [52]. Dehydration or water removal as a hydrate preventive approach is recommended as a long-term remedy [53, 54]. The problem of hydrate formation will disappear if there is no water in the stream, however due to human footprint limits, this is an economically unviable option. This approach, on the other hand, is extremely effective for gas processing facilities and other downstream applications [55]. Hydrate mitigation can also be achieved by pumping chemicals into the system to keep operating temperatures and pressures outside of the hydrate formation zone, so maintaining a hydrate-free region. These molecules either delay or change the phase behaviour of the newly formed mixture [5]. Chemical inhibition is the most appropriate preventive method among those mentioned above, and as such, it is often utilised in oil and gas pipelines. Chemical inhibitors are non-disruptive and 9 Machine Learning Application in Gas Hydrates 159 do not obstruct pipeline flow, resulting in a consistent, smooth stream flow [56–58]. According to prior research, the hydrate inhibition technique of adding inhibitors is the sole viable option in the vast majority of cases [12]. The next section delves more into the various types and qualities of gas hydrate inhibitors. 9.4 Chemical Inhibition of Gas Hydrates Chemical inhibitors used to prevent hydrate formation are divided into two types based on dosage: thermodynamic hydrate inhibitors (THIs) and low dose hydrate inhibitors (LDHIs) (LDHIs). 9.4.1 Thermodynamic Hydrate Inhibitors (THIs) The THIs are used in large concentrations in the gas–water stream to prevent hydrate formation in gas production systems. THIs shift the hydrate formation equilibrium curve to the left, shifting the site of hydrate formation to a higher pressure and lower temperature, maintaining it outside the hydrate formation area [4, 49, 59]. Methanol (MeOH) and monoethylene glycol (MEG) are two more commercial THIs that are commonly used [12]. MeOH and MEG’s inhibitory efficacy is due to the interaction of the inhibitor oxygen atoms with the surrounding water molecules [60]. The lone electron of the hydrogen atom migrates to the other covalently bonded atom, leaving the positively charged hydrogen proton exposed. The proton is attracted to the negatively charged ends of other molecules and establishes an electrostatic bond with one of the other electrons [60]. The selection of thermodynamic inhibitors necessitates a comparison of several parameters such as operational cost, safety, corrosion inhibition, physical qualities, and gas dehydration ability [61, 62]. Furthermore, waste chemical recovery, regeneration, and reinjection are key considerations that should be considered during the selection process. THIs are employed in concentrations ranging from 1 to 50 weight percent to suppress gas hydrate formation [12, 63]. The precise concentration value employed for the application is determined by the operational situation and the temperature of the surrounding environment. Cha et al. [43] examined the thermodynamic inhibition performance of monoethylene glycol (MEG) for pure CH4 at concentrations of 10, 30, and 50% wt. Ng and Robinson [64] studied the capacity of methanol to inhibit methane hydrate formation. Following that, Anderson et al. [65] studied the effect of methanol on methane hydrate generation, and their findings agreed with those of Ng and Robinson. The temperature and pressure profile of a 50-mile-long natural gas pipeline from the well head to the production platform of a deep-water field in the Gulf of Mexico is seen in Fig. 9.2 [18]. In this case, thermodynamic inhibitors such as methanol are injected into the pipeline in varying mass amounts to ensure that the operating state is set beyond the hydrate formation area. Methanol’s inhibitory impact is described 160 A. Qasim and B. Lal Fig. 9.2 The temperature and pressure profile for Gulf of Mexico pipeline in the presence of conventional THI (methanol) [18] by the degree to which the hydrate equilibrium curve moves from hydrate generating regions to hydrate free zones. Despite the fact that commercial THIs can significantly reduce the likelihood of hydrate formation in petroleum pipelines, their extremely volatile and environmentally hazardous nature limits their use [46, 47]. The quest for new THIs is important to ensuring long-term environmental and economic sustainability. 9.4.2 Low Dosage Hydrate Inhibitors (LDHIs) During the exploration of advanced hydrate mitigation technologies, the emphasis changed from hydrate removal to hydrate management employing LDHIs. LDHIs are used in small amounts, ranging from 0.5 to 2.0 wt% of water reductions [16, 58]. They are non-volatile and largely non-hazardous to the environment; they are further classed as Kinetic Hydrate Inhibitors (KHIs) and Anti-Agglomerates (AAs) [66, 67]. KHIs are water-soluble polymers like polyvinylpyrrolidone (PVP) and polyvinylcaprolactam (PVCap), whereas AAs are typically surfactant molecules [68, 69]. • Kinetic Hydrate Inhibitors (KHIs) KHIs prevent hydrate blockage by delaying formation and avoiding nucleation for a longer period of time than the free water phase’s residence time in the flow line [16]. The hydrate nucleation time is another term for the induction time. It is the amount of time that elapsed between the equilibrium condition and the production of the first hydrate crystal nucleus with the necessary stable properties [70, 71]. KHIs are used at modest doses (0.5–2 wt%) and their effectiveness is time-dependent, as contrast to thermodynamic inhibitors [72, 73]. The deeper a system goes into the hydrate area, the more likely it is that hydrate production will need the use of kinetic hydrate inhibitors as a viable option [74, 75]. KHIs prevent hydrates by restricting crystal nucleation and growth at the crystal’s surface by adsorption [76, 77]. Because they are hydrocarbon phase sensitive, they can be successfully used to a wide range 9 Machine Learning Application in Gas Hydrates 161 of hydrocarbon systems and have seen widespread commercial application over the last two decades. The most commonly used KHI inhibitors in flow assurance are water-based polymers such as polyvinylpyrrolidone (PVP) and polyvinylcaprolactam (PVCap) [78, 79]. In addition to water-soluble polymers, ionic liquids and biomolecules have been used as KHIs. Commercial KHIs (polymers) such as PVP and PVCap are composed of polyethylene strands joined by N atom and C=O group chemical rings that are both polar and spherical. KHI polymers work by adsorbing on the hydrate surface, with the polymer group linked inside the growing hydrate cage at the crystal surface [80]. • Anti-Agglomerates (AAs) Anti-Agglomerate (AA) chemicals keep hydrate crystals in smaller formations within the hydrocarbon stream, preventing bigger crystals from forming. They act by adhering to the surface of small hydration crystals and making their surface hydrophobic, limiting further hydrate crystal formation [2, 81]. Anti-agglomerate hydrate inhibitors can function effectively at higher subcooling temperatures. At high water cuts, they appear inefficient, and they frequently cause emulsion formation in water and hydrocarbon systems. Anti-agglomerants are frequently longer-chained compounds, such as surfactants. When utilised in a pipeline, the hydrophilic (anionic) end of the compound forms dipole-dipole interactions with the water molecule’s hydrogen ion, while the hydrophobic (cationic sections, including the long chain) head dissolves in the oil or gas phase [12]. As early as 1993, Shell Oil Company patented their results for quaternary ammonium surfactants containing two or three n-butyl, n-pentyl, and isopentyl groups that displayed good anti-agglomeration capabilities. Twin-tailed quaternary AAs, such as tetraalkylammonium salts and dicocoyldibutylammonium bromide, were also developed, with the latter being employed in field testing by the Dutch Shell team [82]. Huo et al. [67] used a variety of commercial surfactants in their study, including Span 20, Span 40, Span 60, and Span 80. Their findings showed that the surfactants tested can keep hydrate particles floating at temperatures of 277 K and pressures of 8.20 MPa. Their findings were also compared to dodecyl2-(2-caprolactamyl) ethanamide’s (synthesized AA). The synthesised molecule, on the other hand, displayed improved dispersion under higher water cut conditions, namely 0.75 wt%. The effort to develop low-cost LDHIs for the oil industry motivated Kelland et al [83] to widen their AA study to include polypropoxylates. Polyamine polypropoxylates and other branching polypropoxylates dispersed gas hydrates in a hydrocarbon fluid as long as the fluid was well agitated. 9.5 Flow Assurance Challenge In 1934, Hammerschmidt reported the first industrial research effort on gas hydrates [84]. Since then, significant research on gas hydrate mitigation has been done. Among 162 A. Qasim and B. Lal the flow assurance challenges, the development of gas hydrates in oil and gas pipelines continues to be a major impediment. Every year, industry spends millions of dollars on various techniques to avoid hydrate development. Because this work only works with CH4 and CO2 gases, just a single hydrate structure is formed, and the behaviour of these two gases is examined in depth [5]. In 1888, Villard found methane hydrates as well as other hydrocarbons like ethane, ethylene, and acetylene. Methane hydrate typically forms sI structure as the simplest and smallest guest molecule under suitable pressure and temperature conditions, with both big and microscopic cages of sI hydrate. CH4 hydrates always occupy smaller cavities sI more than larger cavities due to their smaller diameter. The chemical formula of CH4 hydrate for total hydrate cavity occupancy is CH4 .5.75H2 O for small cages and CH4 .7.67H2 O for large cages [27]. Carbon dioxide hydrates were discovered in 1882, and Villard et al. described the phase equilibrium behaviour of CO2 hydrate in the temperature range 267 K to 283 K later that year [85]. Under appropriate temperature and pressure settings, CO2 hydrate forms sI hydrate structure and occupies both large and small cages of structure I. For full hydrate cavity occupancy, the chemical formula of CO2 hydrate is CO2.5.75H2 O [27]. 9.6 Machine Learning in Gas Hydrates The flow assurance industry rquires to resolve the problem of gas hydrate development by introducing appropriate preventive and predictive strategies [86]. The use of Machine Learning (ML) is an innovative risk control technique that is currently being applied. It is basically a numerical representation of a phenomenon, given with a certain significance and based on a certain environment, aimed at performing the desired work [87]. Deployment of ML models would allow us to do predictive analysis of gas hydrate growth because the value of determining hydrate formation is also that the solid crystalline structure which forms like ice will plug the oil and gas pipes as hydrate forms, either during gas production or transmission. This presents a potentially expensive situation for the organisation as it often takes additional time and cost to conduct a corrective intervention. Laboratory experiments are required to determine at which conditions for hydrate to perform. The best practise, therefore, is to predict the formation of hydrates by using the ML model to minimise gas hydrate growth. Artificial neural network (ANN) and Least-squares support-vector machine (LSSVM) are commonly used machine learning techniques in gas hydrate inhibition. ANN is a measurement tool based on the way measurements are carried out by the brain [88]. It has been developed for a wide range of topics, such as classification, approximation of functions and prediction. Inside and between the layers, there are several similarities showing the strength and weights between neurons. Output of the ANN assuming a linear output neuron j, a single hidden layer with h sigmoid hidden nodes and the output variable (xt) is given by. LSSVM development 9 Machine Learning Application in Gas Hydrates 163 is aimed at reducing the complexity of the Support Vector Machine (SVM) and to eliminate complexity in the optimization process, linear formulas are deciphered by linear encoding rather than solving quadratic encoding equations to improve their speed. LSSVM algorithm’s output can be overcome by fixed linear equality rather than inequality constraints. Machine learning has also been used to simulate gas hydrate equilibria, enabling for the construction of models that are better able to anticipate the highly nonlinear, multimodal phenomena of gas hydrate equilibria than those based on statistical thermodynamics. A wide range of machine learning models have been published. Temperature, pressure, and any means of accounting for fluid composition are all frequent input features for developed models. A regression model’s output is either the equilibrium temperature or pressure. It should be emphasized that the models studied were focused on multicomponent hydrocarbons and natural gases. Heydari et al. [89] estimated equilibrium temperature from pressure and specific gravity inputs using neural network models. The relative error (RE) was explored in a comparison of ANN performance analysis, and the maximum error was found to be 3.035%, with an R2 value of 0.9941. To be sure, the results of the ANN were compared to those of the Sloan model and ANN model was found to be a better predicting tool. As a result, it was concluded that ANN is a useful technique for predicting the temperature at which hydrates form. Zeinali et al. [90] created neural network and ANFIS models for temperature and gas composition inputs using a dataset of over 700 points. Ghavipour et al. [91] used leave-one-out cross-validation to develop a model using 130 data points for pressure and gas composition inputs up to n-butane. To forecast hydrate equilibrium conditions in the presence of thermodynamic inhibitors and electrolytes, models have been developed. Elgibaly and Elkamel [92] developed models with up to 16 inputs, such as gas composition, hydrogen sulphide, and inhibitor and electrolyte concentration, which were expanded on by Elgibaly and Elkamel [93], who took inhibitor costs into consideration. While many studies cover a wide range of circumstances, they also include substantial amounts of data for both pure and binary components. Because there is a scarcity of reliable publically available multicomponent data, constructing multicomponent models is difficult. Soroush et al. [94] built a two-hidden-layer neural network from just under 300 equilibrium points from the literature, achieving a holdout validation R2 of 0.998 and, despite a small dataset, restricting the methane + ethane molar gas-phase composition to a minimum of 66.38%, increasing model relevance to natural gas. Support vector machine models are continuously being developed, despite the prominence of neural networks. While neural network models have delivered promising results across a wide range of experimental data, many models’ outcomes lack corresponding error, which can be evaluated via cross-validation processes. Ward et al. [95] emphasised the significance of completely accounting for hydrate metastability in equilibrium experimental results. Because data used to build models is often culled from the literature, confidence in some dated data sources may be strengthened by outdated methods and apparatus. The cross-validated neural network used in their study predicted the hydrate equilibrium pressure for a given temperature and gas mixture. Because large amounts of experimental data from many sources are used to create models, Sloan 164 A. Qasim and B. Lal and Koh proposed that equilibrium be defined as the point at which complete dissociation of generated hydrates occurs. Overall, a strong, flexible alternative to the thermodynamic model is required. Chapoy et al. [96] developed a feed-forward neural network with one hidden layer to calculate hydrate dissociation pressures of natural gases in the presence or absence of inhibitor aqueous solutions. The model was built with more recent hydrate dissociation data from the literature, and its predictions were compared against some independent experimental data. The predictions and experimental findings of this method were reasonably consistent, demonstrating the predictability of the predictive tool developed in this work. The research found that experimental hydrate dissociation data at high inhibitor concentrations is required. Zahedi et al. [88] determined hydrate formation temperature (HFT) using two distinct approaches i.e. statistical and machine learning. In the first strategy, two generic HFT correlations were proposed. In one correlation, there were 11 parameters, while in the other, there were 18. In order to derive constants for the indicated equations, 203 experimental data points were acquired from the literature. The Engineering Equation Solver (EES) and Statistical Package for the Social Sciences (SPSS) software were used to statistically analyse the data. In the second method, HFT is calculated using an artificial neural network (ANN). Different architectures were explored in this scenario, with 70% of the experimental data used for ANN training. Among the numerous architectures, the multilayer perceptron (MLP) network with the trainlm training algorithm was shown to be the best. The ANN model’s good estimation performance is proven when the resulting ANN model outputs are compared to 30% of unseen data. Traditional methods, including our two proposed correlations for HFT estimation, have been shown to be less accurate than ANN. Mohammadi et al. [97] presented a feed forward artificial neural network (ANN) algorithm for estimating dissociation pressures of binary hydrates of tert-butylamine + methane and tert-butylamine + hydrogen as a function of temperature and tert-butylamine concentration in aqueous solution as a function of temperature and tert-butylamine concentration in aqueous solution as a function of temperature and tert-butylamine concentration in This algorithm was built using experimental data from the literature on the dissociation pressures of the aforementioned binary hydrates. This ANN technique proved to be capable of representing these hydrate systems. Yarveicy et al. [98] determined the freezing point depression (FPD) of different electrolyte solutions using a robust kind of machine learning called least squares support vector machine, which is based on statistical learning theory (LSSVM). It was studied as a part in the investigation of the gas hydrate inhibition performance of electrolytic salts such as NaCl, KCl and CaCl2 . The predictions of the developed model were compared to the results of cubic-plus-association (CPA) EoS combined with the Debyee Huckel electrostatic term and they were found to be better. Babakhani et al. [99] used a feed-forward multi-layer artificial neural network to forecast hydrate formation pressure of binary mixtures including at least one hydrocarbon. For this study, 895 experimental data from various studies published in the literature were gathered, covering a wide range of temperatures and compositions. The absolute average relative deviation percent (AARD), mean square error (MSE), and regression coefficient (R2 ) were used to compare different ANN types in order 9 Machine Learning Application in Gas Hydrates 165 to find the best configuration. An R-squared value of 0.9938 was determined which showed good fit. The chosen ANN model demonstrated a high level of agreement with the experimental findings. Baghban et al. [100] devloped SupportVector Machine (SVM) and a SupportVector Machine with Genetic Algorithm (GASVM) to predict semi-clathrate hydrate pressure of CO2 , CH4 , N2 , H2 , Ar, Xe, and H2 S in the presence of TBAB ionic liquid based on the critical temperature (Tc ), critical pressure (Pc ), and acentric factor (ω) of the above-mentioned gases over a wide range of published data. For SVM model, an R-squared value of 0.9776 was obtained and for GAVSM model, it was found to be 0.9994. In the continuation of the use of LSSVM model, Baghban et al. [101] used Katz [102] k-chart data points to estimate natural gas hydrate formation temperature as a function of pressure and gas gravity using the least square support vector machine (LSSVM) technique. In addition, the LSSVM’s hyper parameters were optimised using a genetic method. Furthermore, the present model was compared to five commonly used correlations, with the LSSVM technique having less deviations. The model showed the R-squared value of 0.9973. Recently, Yarveicy et al. [103] modeled gas hydrate phase equilibria using Extremely Randomized Trees and LSSVM approaches. The formation and dissociation conditions of various gases in the presence of pure water, water-based salts, and alcohol solutions were determined in this novel study. The support vector machine’s least square form was also used to create a smart model (LSSVM). For modelling purposes, a large databank containing up to 1840 experimental data on equilibrium conditions of clathrate hydrate formation/dissociation were acquired from the literature (1940–2016). The collected databank covered a wide variety of pressure–temperature conditions for liquid water-hydrate-vapor or ice-hydrate-vapor equilibria. According to the error analysis, all of the suggested models revealed an R-squared value of greater than 0.96. The projections given by the Extra Trees and LSSVM models were found to be in good agreement with the experimental data. In another study, Yarveicy et al. [86] developed new methods for calculating the hydrate formation limits of isenthalpic Joule–Thomson (JT) expansions. First, a new empirical correlation is shown for determining the required minimum initial temperature of a natural gas travelling through a JT expansion without the development of hydrates. The adaptive neurofuzzy inference system (ANFIS), least squares support vector machine (LSSVM), and radial basis function artificial neural network were used to present the models capable of anticipating the gas beginning temperature (RBF-ANN). The methods produced excellent estimations, according to the findings of the performed error analysis. The value of R2 was found to be greater than 0.99 in the proposed models. The RBF ANN model, on the other hand, provided the most accurate estimates. The research by Rebai et al. [104] proposed a two-pronged technique for improving the accuracy with which hydrate formation conditions predicted, particularly for gas mixture systems, by combining thermodynamics with artificial neural network modelling. In this scenario, the Van der Waals-Platteeuw thermodynamic model fails badly. To improve the accuracy of its predictions, an additional correction term was approximated using a trained network of artificial neurons. The total relative 166 A. Qasim and B. Lal error on pressure was reduced from 23.75% to 3.15% after this method was validated using a database of 4660 data points. Hosseinzadeh and others [105] predicted the dissociation pressure of semiclathrate hydrates of CO2 + N2 , CH4 + N2 , CO2 + CH4 , CO2 , CH4 , and N2 systems in the presence of different concentrations of Tetra n-butyl ammonium bromide (TBAB), using a supervised learning technique known as multi-layer perceptron neural network (MLP-NN). The hydrate dissociation pressure was estimated using the molar concentrations of the gases, the weight percent of TBAB, and the temperature of the system. A total of 349 data points were collected from the open literature and divided into three categories: training, validation, and testing, with 70%, 15%, and 15% ratios for each. Landgrebe et al. [106] worked on a supervised neural network multilayer perceptron that was trained with backpropagation to successfully model gas hydrate equilibrium with an emphasis on multicomponent gases. The reserachers employed deep learning method. It yielded an average cross-validation-adjusted coefficient of determination of 0.9867, a standard deviation of 0.0030, and a holdout validated R-adjusted squared of 0.9926. The input variables of temperature and pressure were used for machine learning and output variable of equilibrium pressure. Acharya et al. [107] utilised machine learning (ML) to train and evaluate the performance of three algorithms to predict hydrate dissociation temperatures as a function of the constituent hydrate precursors and inhibitors on an experimental database (>1800 data points). In addition, unlike most previous research, we use thermodynamic properties as input features in the prediction algorithms, such as the activity-based contribution due to electrolytes, partial pressure of specific gases, and specific gravity of the total mixture. Random Forest (RF), Extra Trees (ET), and Extreme Gradient Boosting (XGBoost), three machine learning approaches, all showed high accuracy in estimating hydrate equilibrium conditions. For all of the ML models, the cumulative coefficient of determination (R2 ) percentage is greater than 97%. XGBoost surpasses RF and ET in terms of overall coefficient of determination (R2 ) and average absolute relative deviation (AARD), with 99.56% and 0.086%, respectively. Predicting the formation conditions of gas hydrates in salt water is crucial for hydrate management in activities such as flow assurance, deep-sea drilling, and hydrate-based technology development. In this regard, Xu et al. [108] recently employed five machine learning methods to develop prediction tools for calculating the temperature of methane hydrate formation in the presence of salt water in this study. Machine learning methods included Multiple Linear Regression, k-Nearest Neighbor, Support Vector Regression, Random Forest, and Gradient Boosting Regression. A total of 702 experimental data points from the literature were collected for modelling purposes between 1951 and 2020. The literature clearly shows that the use of machine learning techniques in gas hydrate studies is pertinent and different parameters including but not limited to hydrate formation temperature and pressure can successfuly be predicted. In the upcoming section, the case studies related to machine learning application in gas hydrates are presented and discussed. 9 Machine Learning Application in Gas Hydrates 167 9.7 Case Study This work involves the use of the data from the flowloop tests performed across a wide variety of experimental conditions at two pilot-scale flowloop facilities (FL1 and FL2), and field data from a dry tree facility in the Gulf of Mexico [109]. Srivastava et al. [109] determined regression, classification, and feature learning are used to analyse data sets from: (1) hydrate tests conducted at pilot-scale flowloop facilities (4,500 data points) and (2) transient operation field data using an algorithm like support vector machine (SVM) and neural networks (NN). Several independent input variables based on flowloop test data are used to calculate the hydrate fraction and probability of hydrate plugging in the pipeline, including water cut, gas-oil ratio, hydrate particle cohesive force, fluid velocity, oil viscosity, specific gravity, interfacial tension, and time in the hydrate stable zone. Using field data as input, including water cut, shut-down period (where applicable), and gas-oil ratio, the semisupervised learning model was utilised to determine the level of hydrate resistance to flow during restart or dead oil displacement following production shut-down. The flowloop-based machine learning model demonstrated high prediction accuracies in test and validation processes, and it was used to evaluate hydrate risks in a real field. The ability to construct field risk maps was demonstrated by a machine learning model based on field data. The hydrate management technique could be used to estimate the risk of hydrate development in subsea oil/gas pipelines using machine learning. As a companion to more complex transient multiphase flow simulations, this machine learning approach can aid in the development of sophisticated hydrate management strategies. In classification predictive modelling, approximating a mapping function (f) from input variables (X) to a discrete output variable is a data mining task (y). Some of the process variables (features) detected in the flowloop tests in this work are water cut, GOR, surface fluid velocity, oil specific gravity (SG), interfacial tension (IFT), viscosity, hydrate volume fraction (HVF), and hydrate inter-particle cohesive force (Fa). A value between 0 and 1 is assigned as a binary classification output and rounded up to the nearest integer. It designates probability of failure. The value of 0 indicates no plug formation while 1 means complete plug formation. This categorization model is depicted in Fig. 9.3. The machine learning algorithms/frameworks used in the model are the support vector classifier (SVC) and artificial neural networks (ANN). Figure 9.4 compares the HVF predicted by the neural network regression to the HVF recorded during the procedure to highlight the test and validation results. For the 913 test data points, the mean absolute error (MAE) was 0.018, the mean square error (MSE) was 0.0009, and the coefficient of determination (R2) was greater than 0.92. The results of the tests show that neural network regression is good at predicting hydrate formation and improves the applicability of the risk classification model indicated above. 168 A. Qasim and B. Lal Fig. 9.3 A simple binary classification model that employs flowloop testing to predict the likelihood of hydrate clogging [109] Fig. 9.4 Comparison of predicted and measured values of Hydrate volume fraction in the pipe using ANN model [109] 9.8 Conclusion Machine learning application in gas hydrate inhibition prediction and analysis is now well-established field of study in recent years as the power of computing has strengthened. In the flow assurance application regarding gas hydrate inhibition, most frequently, machine learning has been used to simulate gas hydrate equilibria, allowing models to be created that are better able to anticipate the highly nonflinear, multimodal phenomena of gas hydrate equilibria than statistical thermodynamics models. Various machine learning models have been published. Temperature, pressure, gas hydrate saturation and fluid composition prediction are all frequent input features for developed models. A regression model determines the equilibrium temperature, pressure or the desired output value. In the literature, both supervised and unsupervised learning methods have been employed for the application. As an instance in a previous study, a deep learning based model was used to predict 9 Machine Learning Application in Gas Hydrates 169 the hydrate equilibrium pressure. The higher R-squared value indicated a good fit. Among the different case studies, it was observed that the prediction accuracy of machine learning is strongly dependent on the amount of data input as large number of data points are suitable for the accurate prediction Apart from hydrate equilibrium temperature or pressure, different machine learning algorithms such as Ridge Regression, Decision Tree, Random Forest, AdaBoost and Neural Network have been employed to predict gas hydrate saturation values for number of well log combinations. In this case the results of neural network algorithm provided higher accuracy. The success of the machine learning model was due to ample availibity of required data points. Hydrate plugging risk can also be predicted through machine learning. In future, the use of machine learning can be enhaced further as the prediction algorithms get better and more reliable. The use of machine learning algorithms in flow loop can provide real time data to help improve the smooth flow of oil in the pipeline at commercial scale. References 1. Makogon YF (2010) Natural gas hydrates—a promising source of energy. J Nat Gas Sci Eng 2:49–59 2. Sefidroodi H, Cheng Chua P, Kelland MA (2011) THF hydrate crystal growth inhibition with small anionic organic compounds and their synergistic properties with the kinetic hydrate inhibitor poly(N-vinylcaprolactam). Chem Eng Sci 66:2050–2056 3. Khan MS, Lal B, Shariff AM, Mukhtar H (2019) Ammonium hydroxide ILs as dual-functional gas hydrate inhibitors for binary mixed gas (carbon dioxide and methane) hydrates. J Mol Liq 274:33–44 4. Bavoh CB, Partoon B, Lal B, Keong LK (2016) Methane hydrate-liquid-vapour-equilibrium phase condition measurements in the presence of natural amino acids. J Nat Gas Sci Eng 37:425–434 5. Lal B, Nashed O, Chemical additives for gas hydrates 6. Akhfash M, Arjmandi M, Aman ZM, Boxall JA, May EF (2017) Gas hydrate thermodynamic inhibition with MDEA for reduced MEG circulation. J Chem Eng Data 62:2578–2583 7. Sun SC, Liu CL, Meng QG (2015) Hydrate phase equilibrium of binary guest-mixtures containing CO2 and N2 in various systems. J Chem Thermodyn 84:1–6 8. Li X-S, Xu C-G, Zhang Y, Ruan X-K, Li G, Wang Y (2016) Investigation into gas production from natural gas hydrate: a review. Appl Energy 172:286–322 9. Qasim A, Khan MS, Lal B, Shariff AM (2019) Phase equilibrium measurement and modeling approach to quaternary ammonium salts with and without monoethylene glycol for carbon dioxide hydrates. J Mol Liq 282:106–114 10. Qasim A., Lal B., Shariff A.M. IMC (2020) Role of ionic liquid-based multipurpose gas hydrate and corrosion inhibitors in gas transmission pipeline. In: Inamuddin AA (eds) Nanotechnol. Life Sci. Springer, Cham, Ist. Springer, Cham, pp 221–244 11. Mohammadi AH, Anderson R, Tohidi B (2005) Carbon monoxide clathrate hydrates: equilibrium data and thermodynamic modeling. AIChE J 51:2825–2833 12. Qasim A, Khan MS, Lal B, Shariff AM (2019) A perspective on dual purpose gas hydrate and corrosion inhibitors for flow assurance. J Pet Sci Eng 183:106418 13. Lal B, Qasim A, Sharif AM (2021) Ionic Liquids in Flow Assurance, 1st ed. https://doi.org/ 10.1007/978-3-030-63753-8 14. Sloan ED (2005) A changing hydrate paradigm—from apprehension to avoidance to risk management. Fluid Phase Equilib 228–229:67–74 170 A. Qasim and B. Lal 15. Cha M, Shin K, Kim J, Chang D, Seo Y, Lee H, Kang S-P (2013) Thermodynamic and kinetic hydrate inhibition performance of aqueous ethylene glycol solutions for natural gas. Chem Eng Sci 99:184–190 16. Khan MS, Cornelius BB, Lal B, Bustam MA (2018) Kinetic assessment of tetramethyl ammonium hydroxide (Ionic Liquid) for carbon dioxide, methane and binary mix gas hydrates. In: Rahman MM (ed) Recent Adv. Ion. Liq. IntechOpen, London, UK, pp 159–179 17. Khan MS, Partoon B, Bavoh CB, Lal B, Mellon NB (2017) Influence of tetramethylammonium hydroxide on methane and carbon dioxide gas hydrate phase equilibrium conditions. Fluid Phase Equilib 440:1–8 18. Koh CA (2002) Towards a fundamental understanding of natural gas hydrates. Chem Soc Rev 31:157–167 19. Xu C-G, Li X-S (2015) Research progress on methane production from natural gas hydrates. RSC Adv 5:54672–54699 20. Khan MS, Lal B, Bavoh CB, Keong LK, Bustam A (2017) Influence of ammonium based compounds for gas hydrate mitigation: a short review. Indian J Sci Technol 10:1–6 21. Hassan S, Adam F, Abu Bakar MR, Abdul Mudalip SK (2019) Evaluation of solvents’ effect on solubility, intermolecular interaction energies and habit of ascorbic acid crystals. J Saudi Chem Soc 23:239–248 22. Abolala M, Varaminian F (2015) Thermodynamic model for predicting equilibrium conditions of clathrate hydrates of noble gases + light hydrocarbons: combination of Van der WaalsPlatteeuw model and sPC-SAFT EoS. J Chem Thermodyn 81:89–94 23. Hassanpouryouzband A, Joonaki E, Vasheghani Farahani M et al (2020) Gas hydrates in sustainable chemistry. Chem Soc Rev 49:5225–5309 24. Nashed O, Partoon B, Lal B, Sabil KM, Shariff AM (2018) Review the impact of nanoparticles on the thermodynamics and kinetics of gas hydrate formation. J Nat Gas Sci Eng 55:452–465 25. Sum AK, Koh CA, Sloan ED (2009) Clathrate hydrates: from laboratory science to engineering practice. Ind Eng Chem Res 48:7457–7465 26. Jensen L, Thomsen K, Von Solms N (2011) Inhibition of structure I and II gas hydrates using synthetic and biological kinetic inhibitors. Energy Fuels 25:17–23 27. Del Villano L, Kelland MA (2010) An investigation into the kinetic hydrate inhibitor properties of two imidazolium-based ionic liquids on Structure II gas hydrate. Chem Eng Sci 65:5366– 5372 28. Koh CA, Sloan ED, Sum AK, Wu DT (2011) Fundamentals and applications of gas hydrates. Annu Rev Chem Biomol Eng 2:237–257 29. Qasim A, Khan MS, Lal B, Ismail MC, Rostani K (2020) Quaternary ammonium salts as thermodynamic hydrate inhibitors in the presence and absence of monoethylene glycol for methane hydrates. Fuel 259:116219 30. Tariq M, Rooney D, Othman E, Aparicio S, Atilhan M, Khraisheh M (2014) Gas hydrate inhibition : a review of the role of ionic liquids. Ind Eng Chem Res 53:17855–17868 31. Sloan ED, Koh CA, Sum AK (2010) Gas hydrate stability and sampling: the future as related to the phase diagram. Energies 3:1991–2000 32. Wang Y, Feng JC, Sen LX, Zhang Y (2018) Influence of well pattern on gas recovery from methane hydrate reservoir by large scale experimental investigation. Energy 152:34–45 33. Chatti I, Delahaye A, Fournaison L, Petitet JP (2005) Benefits and drawbacks of clathrate hydrates: a review of their areas of interest. Energy Convers Manag 46:1333–1343 34. Demirbas A (2010) Methane hydrates as potential energy resource: part 2—methane production processes from gas hydrates. Energy Convers Manag 51:1562–1571 35. Sain K, Gupta H (2012) Gas hydrates in India: potential and development. Gondwana Res 22:645–657 36. Yin Z, Chong ZR, Tan HK, Linga P (2016) Review of gas hydrate dissociation kinetic models for energy recovery. J Nat Gas Sci Eng 35:1362–1387 37. Qureshi MF, Khraisheh M, AlMomani F (2020) Experimentally measured methane hydrate phase equilibria and ionic liquids inhibition performance in Qatar’s seawater. Sci Rep 10:1–14 9 Machine Learning Application in Gas Hydrates 171 38. Babaee S, Hashemi H, Mohammadi AH, Naidoo P, Ramjugernath D (2015) Kinetic and thermodynamic behaviour of CF4 clathrate hydrates. J Chem Thermodyn 81:52–59 39. Bahadori A, Vuthaluru HB (2009) A novel correlation for estimation of hydrate forming condition of natural gases. J Nat Gas Chem 18:453–457 40. Haghighi H, Chapoy A, Burgess R, Tohidi B (2009) Experimental and thermodynamic modelling of systems containing water and ethylene glycol: application to flow assurance and gas processing. Fluid Phase Equilib 276:24–30 41. Obanijesu EO, Gubner R, Barifcani A, Pareek V, Tade MO (2014) The influence of corrosion inhibitors on hydrate formation temperature along the subsea natural gas pipelines. J Pet Sci Eng 120:239–252 42. Karamoddin M, Varaminian F (2013) Water desalination using R141b gas hydrate formation. Desalin Water Treat 52:2450–2456 43. Cha JH, Seol Y (2013) Increasing gas hydrate formation temperature for desalination of high salinity produced water with secondary guests. ACS Sustain Chem Eng 1:1218–1224 44. Panwar NL, Kaushik SC, Kothari S (2011) Role of renewable energy sources in environmental protection: a review. Renew Sustain Energy Rev 15:1513–1524 45. Linga P, Kumar R, Lee JD, Ripmeester J, Englezos P (2010) A new apparatus to enhance the rate of gas hydrate formation: application to capture of carbon dioxide. Int J Greenh Gas Control 4:630–637 46. Yaqub S, lal B, Kok Keong L (2019) Thermodynamic and kinetic effect of biodegradable polymers on carbondioxide hydrates. J Ind Eng Chem 79:131–145 47. Yaqub S, Lal B, Partoon B, Mellon NB (2018) Investigation of the task oriented dual function inhibitors in gas hydrate inhibition: a review. Fluid Phase Equilib 477:40–57 48. Bavoh CB, Lal B, Nashed O, Khan MS, Keong LK, Bustam MA (2016) COSMO-RS: an ionic liquid prescreening tool for gas hydrate mitigation. Chinese J Chem Eng 11:1619–1624 49. Khan MS, Mellon NB, Lal B (2016) Prelimnary Experimental evaluation for Methane (CH4) and Carbon dioxide (CO2 ) Gas hydrate mitigation. Procedia Eng 148:932–940 50. Bavoh C ius B, Lal B, Khan MS, Osei H, Ayuob M (2018) Inhibition effect of 1-ethyl-3methylimidazolium chloride on methane hydrate equilibrium. J Phys Conf Ser, p 012060 51. Chua PC, Sæbø M, Lunde A, Kelland MA (2011) Dual kinetic hydrate inhibition and scale inhibition by polyaspartamides. Energy Fuels 25:5165–5172 52. Khan MS, Lal B, Keong LK, Ahmed I (2019) Tetramethyl ammonium chloride as dual functional inhibitor for methane and carbon dioxide hydrates. Fuel 236:251–263 53. Netušil M, Ditl P (2012) Natural gas dehydration. Nat Gas Extr to End Use. https://doi.org/ 10.1016/B978-0-12-801499-8.00007-9 54. Gonfa G, Bustam MA, Sharif AM, Mohamad N, Ullah S (2015) Tuning ionic liquids for natural gas dehydration using COSMO-RS methodology. J Nat Gas Sci Eng. https://doi.org/ 10.1016/j.jngse.2015.09.062 55. Harrison SE (2010) Natural gas hydrates 56. Turosung SN, Ghosh B (2017) Application of ionic liquids in the upstream oil industry-a review. Int J Petrochemistry Res 1:50–60 57. Ke W, Chen D (2019) A short review on natural gas hydrate, kinetic hydrate inhibitors and inhibitor synergists. Chinese J Chem Eng 27:2049–2061 58. Sayani JKS, Pedapati SR, Lal B (2020) Phase behavior study on gas hydrates formation in gas dominant multiphase pipelines with crude oil and high CO2 mixed gas. Sci Rep 10:1–12 59. Avula VR, Gardas RL, Sangwai JS (2014) Modeling of methane hydrate inhibition in the presence of green solvent for offshore oil and gas pipeline. Proc Int Offshore Polar Eng Conf 3:49–54 60. Israelachvili JN (2011) Intermolecular and surface forces, 3rd edn. Elsevier, Waltham 61. Khan MS, Lal B, Keong LK, Sabil KM (2018) Experimental evaluation and thermodynamic modelling of AILs alkyl chain elongation on methane riched gas hydrate system. Fluid Phase Equilib 473:300–309 62. Sa JH, Lee BR (2011) Amino acids as natural inhibitors for hydrate formation in CO2 sequestration. Environ Sci Technol 45:5885–5891 172 A. Qasim and B. Lal 63. Sayani JKS, Pedapati SR, Kassim Z, Lal B (2021) Investigation on thermodynamic equilibrium conditions of methane hydrates in multiphase gas-dominant pipelines. ACS Omega 6:2505–2512 64. Heng-Joo Ng DBR, Ng HJ, Robinson DB (1985) Hydrate formation in systems containing methane, ethane, propane, carbon dioxide or hydrogen sulfide in the presence of methanol. Fluid Phase Equilib 21:145–155 65. Anderson FE, Prausnitz JM (1986) Inhibition of gas hydrates by methanol. AIChE J 32:1321– 1333 66. Kannan K, Punase A (2009) Low dosage, high efficiency and environment friendly inhibitors: a new horizon in gas hydrates mitigation in production systems. Soc Pet Eng Eur Conf Exhib 67. Huo Z, Freer E, Lamar M, Sannigrahi B, Knauss DM, Sloan ED (2001) Hydrate plug prevention by anti-agglomeration. Chem Eng Sci 56:4979–4991 68. Sharifi H, Ripmeester J, Walker VK, Englezos P (2014) Kinetic inhibition of natural gas hydrates in saline solutions and heptane. Fuel 117:109–117 69. Lee W, Shin JY, Cha JH, Kim KS, Kang SP (2016) Inhibition effect of ionic liquids and their mixtures with poly(N-vinylcaprolactam) on methane hydrate formation. J Ind Eng Chem 38:211–216 70. Saberi A, Alamdari A, Rasoolzadeh A, Mohammadi AH (2020) Insights into kinetic inhibition effects of MEG, PVP, and L-tyrosine aqueous solutions on natural gas hydrate formation. Pet Sci. https://doi.org/10.1007/s12182-020-00515-0 71. Sa J-H, Kwak G-H, Lee BR, Park D-H, Han K, Lee K-H (2013) Hydrophobic amino acids as a new class of kinetic inhibitors for gas hydrate formation. Sci Rep 3:2428 72. Del Villano L, Kommedal R, Kelland MA (2008) Class of kinetic hydrate inhibitors with good biodegradability. Energy Fuels 22:3143–3149 73. Bavoh CB, Lal B, Ben-Awuah J, Khan MS, Ofori-Sarpong G (2019) Kinetics of mixed amino acid and ionic liquid on CO2 hydrate formation. IOP Conf Ser Mater Sci Eng 495:012073 74. Mokhatab S, Wilkens RJ, Leontaritis KJ (2007) A Review of strategies for solving gas-hydrate problems in subsea pipelines. Energy Sources Part A Recover Util Environ Eff 29:39–45 75. Haniffa MAM, Hashim FM (2011) Review of hydrate prevention methods for deepwater pipelines. 2011 IEEE Conf Open Syst ICOS, 165–171 76. Moore JA, Ver Vers L, Conrad P (2009) Understanding kinetic hydrate inhibitor and corrosion inhibitor interactions. In: Offshore technology conference Houston, Texas, pp 1–20 77. Kang SP, Shin JY, Lim JS, Lee S (2014) Experimental measurement of the induction time of natural gas Hydrate and its prediction with polymeric kinetic inhibitor. Chem Eng Sci 116:817–823 78. Zeng H, Wilson LD, Walker VK, Ripmeester JA (2006) Effect of antifreeze proteins on the nucleation, growth, and the memory effect during tetrahydrofuran clathrate hydrate formation. J Am Chem Soc 128:2844–2850 79. Sloan ED, Subramanian S, Matthews PN, Lederhos JP, Khokhar AA (1998) Quantifying hydrate formation and kinetic inhibition. Ind Eng Chem Res 37:3124–3132 80. Ke W, Kelland MA (2016) Kinetic hydrate inhibitor studies for gas hydrate systems: a review of experimental equipment and test methods. Energy Fuels 30:10015–10028 81. Norland AK, Kelland M (2011) the Crystal growth inhibition of tetrahydrofuran hydrate with polyquaternary ammonium salts. 7th Int Conf Gas Hydrates (ICGH 2011). https://doi.org/10. 1016/j.ces.2011.11.003 82. Kelland MA (2006) History of the development of low dosage hydrate inhibitors. Energy Fuels 20:825–847 83. Kelland MA, Svartås TM, Andersen LD (2009) Gas hydrate anti-agglomerant properties of polypropoxylates and some other demulsifiers. J Pet Sci Eng 64:1–10 84. Hammerschmidt EG, Natural T, Company G (1934) Gas hydrates in natural gas transmission lines. Ind Eng Chem 26:851–855 85. Villard P (1888) On some new gas hydrates. Compt Rend 106:1602–1603 86. Yarveicy H, Ghiasi MM, Mohammadi AH (2018) Determination of the gas hydrate formation limits to isenthalpic Joule—Thomson expansions. Chem Eng Res Des 132:208–214 9 Machine Learning Application in Gas Hydrates 173 87. Irfan SA, Azeem B, Irshad K, Kushaari K (2020) Machine learning model for nutrient release from biopolymers coated controlled-release fertilizer, 1–12 88. Zahedi G, Karami Z, Yaghoobi H (2009) Prediction of hydrate formation temperature by both statistical models and artificial neural network approaches. Energy Convers Manag 50:2052– 2059 89. Shavesteh K, Heydari A, Kamalzadeh L, Aliaskari F (2006) Prediction of hydrate formation temperature for natural gas using artificial neural network. CHISA 2006—17th international congress chemistry process engineering 90. Zeinali N, Saber M, Ameri A (2012) Comparative analysis of hydrate formation pressure applying cubic equations of state (eos), artificial neural network (ann) and adaptive neurofuzzy inference system (anfis). Int J Thermodyn 15:91–101 91. Ghavipour MM, Ghavipour MM, Chitsazan M, Najibi SH, Ghidary SS (2013) Experimental study of natural gas hydrates and a novel use of neural network to predict hydrate formation conditions. Chem Eng Res Des 91:264–273 92. Elgibaly AA, Elkamel AM (1998) A new correlation for predicting hydrate formation conditions for various gas mixtures and inhibitors. Fluid Phase Equilib 152:23–42 93. Elgibaly A, Elkamel A (1999) Optimal hydrate inhibition policies with the aid of neural networks. Energy Fuels 13:105–113 94. Soroush E, Mesbah M, Shokrollahi A, Rozyn J, Lee M, Kashiwao T, Bahadori A (2015) Evolving a robust modeling tool for prediction of natural gas hydrate formation conditions. J Unconv Oil Gas Resour 12:45–55 95. Ward Z (2015) Phase equilibria of gas hydrates containing hydrogen sulfide and carbon dioxide. Colorado school of mines 96. Chapoy A, Mohammadi AH, Richon D (2007) Predicting the hydrate stability zones of natural gases using artificial neural networks. Oil Gas Sci Technol. https://doi.org/10.2516/ogst:200 7048 97. Mohammadi AH, Richon D (2010) Use of an artificial neural network algorithm to determine pressure-temperature phase diagrams of tert-butylamine + methane and tert-butylamine + hydrogen binary hydrates. Ind Eng Chem Res 49:10141–10143 98. Yarveicy H, Kariman A, Ghiasi MM (2014) Practical use of statistical learning theory for modeling freezing point depression of electrolyte solutions : LSSVM model. J Nat Gas Sci Eng 20:414–421 99. Babakhani SM, Bahmani M, Shariati J, Badr K, Balouchi Y (2015) Comparing the capability of artificial neural network (ANN) and CSMHYD program for predicting of hydrate formation pressure in binary mixtures. J Pet Sci Eng 136:78–87 100. Baghban A, Ali M, Pouladi B, Amanna B (2015) The Journal of Supercritical Fluids Phase equilibrium modeling of semi-clathrate hydrates of seven commonly gases in the presence of TBAB ionic liquid promoter based on a low parameter connectionist technique 101:184–192 101. Baghban A, Namvarrechi S, Phung LTK, Lee M, Bahadori A, Kashiwao T (2016) Phase equilibrium modelling of natural gas hydrate formation conditions using LSSVM approach. Pet Sci Technol 34:1431–1438 102. Rzasa MJ, Katz DL (1945) Calculation of static pressure gradients in gas wells. Trans AIME 160:100–113 103. Yarveicy H, Ghiasi MM (2017) Modeling of gas hydrate phase equilibria: extremely randomized trees and LSSVM approaches. J Mol Liq 243:533–541 104. Rebai N, Hadjadj A, Benmounah A, Berrouk AS, Boualleg SM (2019) Prediction of natural gas hydrates formation using a combination of thermodynamic and neural network modeling. J Pet Sci Eng 182:106270 105. Hosseinzadeh A, Mohammadi A, Soroush E (2020) Predicting semiclathrate hydrates dissociation pressure using a rigorous machine learning approach. J Dispers Sci Technol 41:863–872 106. Landgrebe MKB, Nkazi D (2019) Toward a robust, universal predictor of gas hydrate equilibria by means of a deep learning regression. https://doi.org/10.1021/acsomega.9b02961 174 A. Qasim and B. Lal 107. Acharya P V., Bahadur V (2021) Thermodynamic features-driven machine learning-based predictions of clathrate hydrate equilibria in the presence of electrolytes. Fluid Phase Equilib. https://doi.org/10.1016/j.fluid.2020.112894 108. Xu H, Jiao Z, Zhang Z, Huffman M, Wang Q (2021) Prediction of methane hydrate formation conditions in salt water using machine learning algorithms. Comput Chem Eng 151:107358 109. Qin H, Srivastava V, Wang H, Science C, Zerpa LE, Koh CA (2019) Machine learning models to predict gas hydrate plugging risks using flowloop and field data. Offshore Technol Conf. https://doi.org/10.4043/29411-MS Chapter 10 Machine Learning Application Guidelines in Flow Assurance Cornelius Borecho Bavoh and Bhajan Lal Abstract In this chapter guidelines for conducting an effective machine learning based prediction models in flow assurance areas is presented with much emphasis of data availability, data representation and model selection. Keywords Machine learning · Flow assurance · Big data · Models 10.1 Introduction Generally, the availability and processing of data is the most critical guidelines for any machine learning applications. This also involves the use of data that well represents the model of the choice. In this chapter we briefly discuss some useful guidelines for use machine learning in flow assurance [1, 2]. 10.2 Data Selection Data is the currency needed to successfully conduct a machine learning prediction. This is the initial and important information needed to train or teach the model. The developed machine’s performance highly depends on the strength or weakness of the data. In the area of flow assurance, data might be experimental thermodynamic or kinetic parameters, images, signals, temperatures, pressures, inhibitors concentrations, additives molecular structures and properties, first-principles calculations, or complex simulation models. The use of big data is highly recommended in flow assurance applications, since this could be readily available from company’s actives C. B. Bavoh · B. Lal (B) Chemical Engineering Department, Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak Darul Ridzuan, Malaysia e-mail: bhajan.lal@utp.edu.my Research Centre for CO2 Capture (RCCO2C), Universiti Teknologi PETRONAS, 32610 Bandar Seri Iskandar, Perak, Malaysia © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 B. Lal et al. (eds.), Machine Learning and Flow Assurance in Oil and Gas Production, https://doi.org/10.1007/978-3-031-24231-1_10 175 176 C. B. Bavoh and B. Lal log data. For some systems such as thermodynamics of most flow assurance aspects, the use of existing simulations (such as PVTSIM, OLGA, etc.) could be the fasters source of huge database. Due to limitations on kinetics data and the high cost of experimentations, the use of published data in patents and articles could be relevant for such simulations. It must be stated that the kinetics of most flow assurance systems are very stochastics and system dependant. This further narrows the challenges of acquiring large flow assurance kinetics related data from literature. Data curation is an important aspect data preparation for the machine learning methods in flow assurance. Issues like data quality which range from the generations to the storage of data must be done in a manner to prevent biases. It is worth noting that, the data size and type is also dependant on the machine learning models. For instant, the data requirement for deep learning systems are different from the traditional modelling. The data used for ANNs are both used for learning and training. That is why they require huge amount of data. On the other hand, the data is mostly splintered into training, validations, and testing. Typically, most author widely use about 70% of the data for training and validation while the remaining 30% is used for testing. The training and validation are done at the same phase because the validation is used to provide an unbiased evaluation of the model fit during the training phase. However, the test data are unseen and is used to finally fit the model. This is mostly known as the main indicator of the model quality [1, 2]. 10.3 Data Representation Aside from the just getting data, the next very important guideline needed to ensure a quality model is the representation of the data. In flow assurance systems the data could either be numerical and in image format. The ability to accurately define the right input model variables or feature is very important to yield an accurate model prediction. This process is known as feature selection and has been the topic of several studies. The feature selection must be done to target the actual variables that affect the output variable to be predicted. Also, the number of variables needed for the prediction must be well considered and properly determined. Limiting the number of selected features may reduce the computational cost of both training and executing the model, while improving the overall accuracy. This feature-selection process is of lesser importance in so-called deep learning methods, which are assumed to internally select those features that are considered to be important. Then, an input layer that consists of basic process parameters in flow assurance (e.g., pressure, temperature, gas gravity, moles consumed, rate of formation, induction time, etc.), feed characterizations (e.g., equilibrium, feed compositions), or hydrocarbon or inhibitor properties (e.g., gravity, concentration, molecular weight, surface tension, activity coefficient etc.) are often sufficient. It is mostly challenging to represent data set that are not numerical, especially when dealing with molecules and reaction in flow assurance systems. In addition, the stochastic nature of most flow assurance areas 10 Machine Learning Application Guidelines … 177 makes it difficult to accurately represent their data set in a machine learning model [1, 2]. 10.4 Model Development The type of model for the selected data is the final step in machine learning modelling. Since there are several machine learning models, it is very difficulty to choose a models. This mostly require fundamental knowledge on the machine learning models coupled with vested command over the respective flow assurance modelling area. Currently in flow assurance modelling authors mostly use random models for predictions and sometimes compare their efficiency amongst themselves and traditional models. There are classification and regression models, however, the use of regression model is mostly used in flow assurance issues. The models could also be unsupervised, supervised, active, or transfer learning [3–5]. Generally, supervised learning is used in flow assurance issues, with few studies based on unsupervised learning. Common techniques such as k-means algorithm, decision trees [5], random forests [6], support vector machines [5], and ANNs [7] can be used for machine learning in flow assurance. Also, the use of hybrid models can be adopted with effective and suitable transfer functions. References 1. Trinh C, Meimaroglou D, Hoppe S (2021) Machine learning in chemical product engineering: the state of the art and a guide for newcomers. Processes. https://doi.org/10.3390/pr9081456 2. Dobbelaere MR, Plehiers PP, Van de Vijver R, Stevens CV, Van Geem KM (2021) Machine learning in chemical engineering: strengths, weaknesses, opportunities, and threats. Engineering 7:1201–1211 3. Obanijesu EO, Omidiora EO (2008) Artificial neural network’s prediction of wax deposition potential of Nigerian crude oil for pipeline safety. Pet Sci Technol 26:1977–1991 4. Hosseinzadeh A, Mohammadi A, Soroush E (2020) Predicting semiclathrate hydrates dissociation pressure using a rigorous machine learning approach. J Dispers Sci Technol 41:863–872 5. Alhashem M (2019) Supervised machine learning in predicting multiphase flow regimes in horizontal pipes. Soc Pet Eng Abu Dhabi Int Pet Exhib Conf 2019, ADIP 2019. https://doi.org/ 10.2118/197545-ms 6. Acharya P V., Bahadur V (2021) Thermodynamic features-driven machine learning-based predictions of clathrate hydrate equilibria in the presence of electrolytes. Fluid Phase Equilib. https://doi.org/10.1016/j.fluid.2020.112894 7. Mohammadi AH, Richon D (2010) Use of an artificial neural network algorithm to determine pressure-temperature phase diagrams of tert-butylamine + methane and tert-butylamine + hydrogen binary hydrates. Ind Eng Chem Res 49:10141–10143
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )