Crude Oil Desalters: The Confluence of First Principles and Machine Learning in Monitoring Performance using Aspen HYSYS and Machine Learning
Emad Gebesy (Ph.D. C.Eng. MIChemE)
Business Consultant (Energy Optimization & Risk Management | Sustainability | Data Analyst | Machine Learning | AI Strategist)
1.??? SelexMB Introduction:
SelexMB, conceptualized and python-programmed by Emad Gebesy in 2020, has emerged as a ground-breaking solution for the oil and gas industry. It harnesses the power of both hybrid modeling and machine learning to provide innovative and effective solutions that optimize operations and decision-making processes.
SelexMB's Unique Approach: SelexMB stands out due to its novel approach, which integrates first principles and machine learning techniques. This combination ensures that the model's predictions are not only accurate but also grounded in real-world engineering knowledge.
Versatile Outputs: SelexMB offers outputs in various formats, ensuring flexibility and usability:
Recognition and Achievements: SelexMB's impact has been recognized on a global scale, as evidenced by its nomination as a finalist in the prestigious IChemE Global Awards 2022. This acknowledgment underscores its significance in the industry and showcases its potential to revolutionize processes and operations.
2.??? Background
In the vast, intricate world of oil refining, the crude oil desalter stands out as a critical cornerstone. Its primary role in this chain is to cleanse the crude oil, ensuring it adheres to the stringent specifications set by the industry. This cleansing is not just a quality measure but an absolute necessity, protecting downstream equipment from potential damage and refining processes from undesirable consequences.
The very essence of crude oil, in its natural state, contains a mix of organic and inorganic components. Among the inorganic components, salts—primarily chlorides of sodium, calcium, and magnesium—pose a significant threat. These salts, when subjected to the high temperatures in refining processes, release corrosive hydrochloric acid. The repercussions are manifold, from damaging expensive refining infrastructure to contaminating the end product, thus leading to economic and quality-related setbacks.
Given the desalter's critical role, one might assume the process is straightforward. In reality, it's anything but. A multitude of factors come into play, affecting the efficiency and effectiveness of desalting operations. These variables range from the crude oil's inherent characteristics to the operational conditions under which desalting occurs. Common influential factors include the mix water temperature, the flow rate of the mix water, the crude feed's temperature, and its rate. Each of these elements can alter the equilibrium, making the prediction of salt content in separated crude a complex undertaking. It's not just about removing salts; it's about achieving an optimal balance to ensure the crude's integrity while maximizing the operational efficiency of the desalter.
Historically, the task of monitoring and optimizing desalters has relied heavily on operators' experience and empirical methods. While these traditional approaches have their merits, they lack the precision and adaptability required to navigate the dynamic landscape of modern refining or production variations to the upstream industry.
Enter the world of data science and computational modeling. The current era, often dubbed the fourth industrial revolution, is characterized by the merger of traditional domain knowledge with advanced computational techniques. In the context of desalters, this means blending the tried-and-tested first principles of chemical engineering with the adaptive, predictive capabilities of machine learning.
This article aims to introduce and explore a ground-breaking approach: a ROM (Reduced Order Model) birthed from the confluence of machine learning and fundamental engineering principles. Such a model's inherent strength lies in its ability to capture the nonlinear interactions and inherent uncertainties associated with the desalting process. Instead of relying solely on empirical data or purely on theoretical calculations, this hybrid model offers a middle ground. It leverages vast amounts of operational data to train and refine itself while remaining rooted in the foundational principles of the desalting process.
For operators and engineers, this presents a paradigm shift. With a robust reduced order model in place, real-time monitoring becomes more precise. Predictive capabilities mean potential issues can be identified and rectified before they escalate, ensuring the desalter operates at its peak efficiency. Moreover, it offers insights, shedding light on the intricate relationships between operational variables and their impact on the desalting process.
3.??? Factors Affecting Desalting Process:
The desalting process, a crucial step in the oil refining journey, is influenced by several interconnected factors. Understanding each of these variables in detail is paramount for ensuring the efficiency of the process. Let’s delve deeper into the pivotal determinants:
In essence, the desalting process is a dance of variables, each contributing to the harmony and efficiency of the system. Perfecting this dance necessitates a keen understanding of each factor and the delicate interplay between them.
4.??? Steady State Modeling and Their Limitations:
Equation of Design: Historically, desalter design and operation have relied on first principles, often represented as: Efficiency(?) = f (Tmw,Tco,Qmw,Qco)
Where:? = Desalting efficiency
Tmw = Mix water temperature
Tco = Crude oil feed temperature
Qmw = Mix water flow rate
Qco = Crude oil rate
However, this equation, while providing a foundation, doesn't encompass the intricate dynamics and nonlinearities present in real-world scenarios.
NaCl Solubility in Water
Sodium chloride (NaCl), also known as table salt, is highly soluble in water. The solubility of NaCl in water depends on temperature and to a lesser extent, pressure.
Governing Equation
Solubility is often expressed as grams of solute (in this case, NaCl) per 100 grams of solvent (water) at a given temperature. One can describe the solubility S using the following equation:
S(T)=S0+aT+bT2
Where:
This equation describes a polynomial fit to the solubility data, but one should note that this is a simplified representation. In reality, the solubility might not always fit a simple polynomial equation.
Let the following symbols denote the given streams:
Mass Balance for Water and Crude:
Using the principle of conservation of mass:
a) For Water: Wi=Wo Assuming no water is lost or gained in the crude.
b) For Crude: Ci=Co Assuming no crude is lost or gained in the water.
Salt Mass Balance:
The total amount of salt entering the desalter (from both the water and the crude) must be equal to the total amount of salt leaving the desalter.
Wi×SWi+Ci×SCi=Wo×SWo+Co×SCo
Substituting the relations from the water and crude balances:
Wi×SWi+Ci×SCi=Wi×SWo+Ci×SCo
From this equation, the relationship between the incoming and outgoing salt concentrations in both the water and the crude can be established.
Limitations
5.??? Dynamic Modeling and 1st Law of Thermodynamics
To model the desalter system using the first law of thermodynamics, it's important to understand that the first law is essentially a statement of energy conservation. It asserts that energy cannot be created or destroyed, only transferred, or converted from one form to another. For a control volume (like the desalter in this case), the net energy transfer is equal to the change in energy within the system.
Oil Phase Mathematical Modeling
Oi: Inflow rate of oil (kg/s)
Oo: Outflow rate of oil (kg/s)
Oacc: Accumulation rate of oil in the desalter (kg/s)
Applying 1st law of thermodynamics, the oil phase can be describing as below.
Oi?Oo=dOacc/dt
Water Phase Mathematical Modeling
Wi: Inflow rate of water (kg/s)
?Wo: Outflow rate of water (kg/s)
Wacc: Accumulation rate of water in the desalter (kg/s)
Applying 1st law of thermodynamics, the water phase can be describing as below.
Wi?Wo=dWacc/dt
Salt Phase Mathematical Modeling
Si: Inflow rate of salt (kg/s)
So: Outflow rate of salt (kg/s)
领英推荐
Sacc: Accumulation rate of salt in the desalter (kg/s)
Considering salt concentration in both the incoming oil and water:
Si=SCi×Oi+SWi×Wi
Similarly, for the outflowing salt (considering the salt is carried away with the separated water phase):
So=SWo×Wo
Applying 1st law of thermodynamics, the salt phase can be describing as below.
Si?So=dSacc/dt
Accumulation: The accumulation of a phase (or component) within the control volume is the net result of what enters, what exits, and what is generated or consumed inside that volume. The term represents the rate of change of mass of the phase/component within the control volume with respect to time.
Given: F=ρ×V
Where:
For a horizontal vessel like a desalter, the cross-sectional area (A) is typically constant for most of its length. Therefore, the volume of liquid (water or oil) is a function of its level (h) and the cross-sectional area.
V=A×h
Water Accumulation (Wacc)
For water: dWacc/dt=A×dhwate/dt ×ρwater
Where hwater is the water level inside the desalter.
Oil Accumulation (Oacc)
For oil: dOacc/dt=A×dhoil/dt×ρoil
Where hoil is the oil level inside the desalter.
(Note: Since the vessel is typically full, any increase in hwater may correspond to a decrease in hoil or vice versa.
Salt Accumulation (Sacc)
Salt accumulation is a bit more complex because the salt's presence is distributed across both the water and oil phases, though primarily in the water.
Given: Sacc=Vwater×SWo+Voil×SCo
dSacc/dt = A×dhwater/dt×SWo+A×dhoil/dt×SCo
Where:
The accumulation terms for the oil and water phases essentially capture the change in the mass of these phases in the desalter with time. Meanwhile, the salt accumulation term captures the combined effect of the salt being carried by both these phases. In modeling and control scenarios, understanding these accumulation terms is crucial for predicting the behavior of the system in transient states, especially when the input conditions (like inlet flow rates or salt concentrations) change. This becomes critical in ensuring that the desalter operates efficiently and effectively under all possible conditions.
Calculating the cross-sectional area (A) for a horizontal cylindrical vessel requires some geometric considerations, especially if you want to link it to the liquid height or level (h) inside the vessel. Here's how you can calculate it:
For a Full Horizontal Cylinder: If the vessel is completely full, the cross-sectional area is simply the area of the circle at the end of the cylinder:
A=πr2
Where r is the radius of the cylinder.
For a Partially Filled Horizontal Cylinder: The calculation becomes more involved when the cylinder is only partially filled. You'll be calculating the area of a segment of the circle. Here's a step-by-step breakdown:
Calculate the Central Angle (θ): This is the angle (in radians) created by lines drawn from the centre of the circle to the liquid's surface edges:
θ=2×arccos(r?h/r)
Calculate the Area of the Sector formed by θ: This area represents the section of the circle bounded by the central angle.
Asector=0.5×θ×r2
Calculate the Area of the Triangle within the Sector: This triangular area will be subtracted from the sector's area to find the liquid's cross-sectional area.
Atriangle=0.5×r2×sin(θ)
Calculate the Area of the Liquid Segment: Subtract the triangle's area from the sector's area:
Aliquid=Asector?Atriangle
So, the cross-sectional area for the liquid in a partially filled horizontal cylindrical vessel is Aliquid.
Engineering and Computational Challenges with 1st Law of Thermodynamics
To describe variations of salt content, oil level, and water level with respect to time in response to changes in inlet/outlet flow, you'll need to integrate the above differential equations with boundary conditions (initial conditions) that describe the initial state of the system.
In a real-world scenario, these relationships would also be influenced by the desalter's operating conditions, the effectiveness of the demulsifies used, temperature effects, and possible interactions between the water and oil phases. If you wish to incorporate thermodynamic effects, you'd also need to consider things like heat transfer due to temperature differences between the feed streams and the desalter or any heat added/removed during the process.
To derive actionable insights, you may need to combine these fundamental equations with empirical data, perhaps even leveraging techniques like computational fluid dynamics or system identification to obtain a more comprehensive model of the system.
6.??? Usability of Machine Learning:
Artificial Neural Networks (ANN) draw inspiration from the biological neural networks found in our brains. Comprising interconnected nodes or "neurons," ANNs facilitate the learning and recognition of complex patterns, making them indispensable tools in diverse applications.
Theory and Structure: At its core, an ANN is structured with layers: an input layer, one or more hidden layers, and an output layer. Each neuron in these layers is connected via pathways, akin to synapses in biological systems. These pathways possess weights, which are adjusted during the learning process.
Fundamental Equation: For a given neuron, the output Y can be mathematically represented as:
Y= f (∑iwixi+b) Where:
ANNs in Desalting Process: The complex, nonlinear nature of desalting processes makes them challenging to model using classical techniques. ANNs, with their inherent ability to model nonlinearities, are aptly suited for this challenge. By feeding extensive data, including operating conditions and resultant salt content, ANNs can learn the intricate relationships between these parameters.
During the training phase, the ANN adjusts its weights based on the error between its predicted and actual outputs. Using algorithms like backpropagation, the network minimizes this error iteratively, refining its internal model. Upon successful training, the ANN can predict salt content in crude under diverse operating conditions with remarkable precision.
Benefits and Utility:
In conclusion, while the theory and mathematical underpinning of ANNs can be intricate, their application in the realm of desalting processes is straightforward: they serve as powerful, adaptable tools that can predict and monitor the performance of desalters, ensuring optimal operation and high-quality output.
7.??? Merging First Principles with Machine Learning:
In the vast, evolving realm of process modeling and system analysis, the approach one chooses can make all the difference. Historically, models were built primarily on first principles—fundamental laws and equations governing the behaviour of a system. However, with the advent of the digital age and the proliferation of computational capabilities, machine learning emerged as a complementary, powerful tool. The true innovation today is not in choosing one over the other but in merging the foundational solidity of first principles with the dynamic adaptability of machine learning. This union, exemplified in a reduced-order model, yields manifold benefits.
In essence, the convergence of first principles and machine learning in the form of reduced-order models signifies a leap in how we approach system modeling and prediction. This synthesis acknowledges that while the foundational laws of science offer unwavering stability, the ever-changing nuances of real-world systems demand adaptability. By championing both, we equip ourselves with a tool that is both rooted in time-tested truths and agile enough to navigate the intricacies of modern-day challenges.
Study Conclusion:
Crude oil desalters are strategic assets in refining operations, ensuring that the crude oil remains within stipulated specs. Traditional models, rooted in first principles, have been fundamental but limited. By integrating the predictive prowess of machine learning, specifically ANNs, with the foundational strength of first principles, we pave the way for a reduced order model that holds promise in enhancing desalter monitoring, ensuring optimal performance, and subsequently, the longevity and efficiency of refining operations.
References:
Lead Engineer at Aramco
1 年Emad ElGebesy (M.Sc MIChemE C.Eng) Very informative, thanks for sharing
Do you know about the hidden acquisition conversations that could derail your career? I'm happy to share them with you!
1 年Very informative!
Oil & Gas | Strategy & Business | Consulting
1 年Couldn’t be more informed. Thanks for the read Emad ElGebesy (M.Sc MIChemE C.Eng)
Process Design Engineer / Technical Writer / Lecturer
1 年Good read. Thank you for posting Emad ElGebesy (M.Sc MIChemE C.Eng)
Process Engineer at Amreya Petroleum Refining Company-APRC [R&D] Department || Freelance Process Simulation Engineer || Aspen HYSYS Trainer || Oil & Gas Instructor.
1 年Thanks for posting eng.emad ??