Crude Oil Desalters: The Confluence of First Principles and Machine Learning in Monitoring Performance using Aspen HYSYS and Machine Learning

Crude Oil Desalters: The Confluence of First Principles and Machine Learning in Monitoring Performance using Aspen HYSYS and Machine Learning

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:

  1. Excel Reports: Detailed reports that provide comprehensive insights into the analysed data, facilitating informed decision-making.
  2. HYSYS Extension: Seamlessly integrates with HYSYS, a widely used simulation software, enhancing its capabilities with advanced modeling and analysis.
  3. Desktop Executable File: Provides a user-friendly interface that enables users to run models, access insights, and make informed decisions without the need for specialized software.

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.

Two Stage Crude Oil Desalter

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:

  1. Mix Water Temperature: At the heart of the desalting mechanism lies the principle of solubility. Salts, as ionic compounds, exhibit varying solubilities depending on the temperature of the solvent. In the context of the desalting process, when the mix water temperature rises, the salts in the crude oil become more soluble in the water phase. This increased solubility translates into a more efficient separation process. The salts dissolved in the mix water can then be easily separated from the crude, leaving behind purer oil. However, it's essential to maintain this temperature within a certain range to ensure the optimal performance of the system without compromising the crude oil's properties.
  2. Mix Water Flow Rate: The essence of desalting is the interaction between the crude oil and the mix water. An effective interaction is achieved when there's thorough mixing, ensuring that the maximum possible surface area between crude oil and mix water is available for salt extraction. A proper flow rate is crucial for this. If the flow rate is too low, there might not be enough mixing, and salt extraction will be inefficient. Conversely, an exceedingly high flow rate might lead to turbulent conditions, potentially causing other operational issues.
  3. Crude Oil Feed Temperature: The physical properties of crude oil, particularly its viscosity, are intrinsically linked to its temperature. As the temperature rises, crude oil becomes less viscous, leading to a more fluidic interaction with the mix water. A less viscous crude oil will separate more efficiently from the mix water, leading to better salt extraction. It's a delicate balance, though. Too high a temperature might cause the oil to break down or cause other operational challenges, whereas too low a temperature will leave the crude too viscous for effective salt separation.
  4. Crude Oil Rate: Every piece of equipment in a process plant has an optimal throughput or rate for peak performance. For desalters, the rate at which crude oil is fed impacts the residence time of the mixture inside the unit. This residence time is crucial: a longer residence time allows for more interaction between the crude oil and mix water, facilitating better salt extraction. However, if the crude oil rate is too high, the mixture might pass through the desalter too quickly, not allowing enough time for effective desalting. On the other hand, a very slow rate might lead to operational inefficiencies.

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:

  • S(T) is the solubility at temperature T.
  • S0,a, and b are constants that would be determined experimentally for the substance in question.
  • T is the temperature.

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:

  • Wi : Water flow rate entering the desalter (kg/s or m3/s)
  • Ci : Crude oil flow rate entering the desalter (kg/s or m3/s)
  • Wo : Water flow rate leaving the desalter (kg/s or m3/s)
  • Co : Crude oil flow rate leaving the desalter (kg/s or m3/s)
  • SWi : Salt concentration in the incoming water (kg salt/kg water or kg salt/ m3 water)
  • SCi : Salt concentration in the incoming crude (kg salt/kg crude or kg salt/ m3 crude)
  • SWo : Salt concentration in the outgoing water (kg salt/kg water or kg salt/ m3 water)
  • SCo : Salt concentration in the outgoing crude (kg salt/kg crude or kg salt/ m3 crude)

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

  • The desalting efficiency, which may vary based on operational conditions, isn't directly incorporated into this basic model.
  • There's no change in volume or mass of water and crude in the desalter. This implies that whatever enters the desalter leaves it, albeit in possibly different states or phases.
  • The desalting process doesn't chemically alter the salt, crude, or water.

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:

  • F = mass flow rate (kg/s)
  • ρ = density (kg/m^3)
  • V = volume flow rate (m^3/s)

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:

  • Vwater and Voil are volumes of water and oil in the desalter.
  • SWo and SCo are the salt concentrations in the water and oil phases, respectively.

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:

  • xi are input values.
  • wi are weights.
  • b is a bias.
  • f is an activation function, introducing non-linearity to the system. Popular activation functions include the sigmoid, hyperbolic tangent, and ReLU (Rectified Linear Unit).

ANN Model

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.

ANN Training

Benefits and Utility:

  1. Adaptability: ANNs excel in environments with changing parameters, making them well-suited for processes with varying operating conditions.
  2. High Accuracy: Given sufficient and quality training data, ANNs can achieve predictions with impressive accuracy, surpassing conventional modeling techniques.
  3. Non-linearity Capture: Unlike many first-principal models, ANNs can model and predict complex nonlinear relationships with ease.

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.

  1. Fidelity to Physical Realities: Foundation on Immutable Laws: First principles, often rooted in laws of physics, chemistry, or other core sciences, offer a robust foundation. These laws, which have been tested and verified across countless experiments and scenarios, provide a stable backbone to any model. Reduced Risk of Erroneous Predictions: A model based solely on data-driven approaches can, at times, stray into physically impossible territories, especially when extrapolating. By anchoring the model to first principles, we ensure that predictions and behaviours adhere to established scientific truths. Consistency Across Systems: First principles provide a consistent framework that is applicable across various systems and scenarios, ensuring a level of uniformity in modeling and predictions.
  2. Dynamic Adaptability of Machine Learning: Modeling Unforeseen Scenarios: No matter how comprehensive, first principles can't always account for every real-world anomaly or unique system behavior. Machine learning, with its ability to learn from data, can capture these nuances, adjusting the model accordingly. Continuous Improvement: One of the hallmarks of machine learning is its iterative nature. As more data becomes available, the model refines itself, enhancing accuracy and predictive capabilities. Handling Non-linearity and Complexity: Real-world systems often exhibit non-linear behaviours or interactions too complex for classical modeling. Machine learning algorithms are adept at navigating these complexities, offering solutions where traditional methods might falter.
  3. Efficiency of Reduced-Order Models: Streamlining Predictions: Reduced-order models, as the name suggests, simplify complex systems into more manageable representations without significantly compromising accuracy. This streamlining accelerates prediction times, essential for real-time applications. Resource Efficiency: In industrial settings, computational resources are often at a premium. Reduced-order models, by virtue of their simplified nature, demand fewer computational resources—be it memory or processing power. This efficiency is particularly beneficial for on-the-ground operators who require quick insights without overburdening the system. Enhanced User Accessibility: For operators or engineers not deeply versed in computational modeling, a reduced-order model offers a more approachable, user-friendly interface, ensuring broader applicability and utility.

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:

  1. SelexMB Software courtesy of Optimize Solutions. 2020
  2. Smith, J.M., Van Ness, H.C., Abbott, M.M. (2005). Introduction to Chemical Engineering Thermodynamics. McGraw Hill.
  3. Goodfellow, I., Bengio, Y., Courville, A. (2016). Deep Learning. MIT Press.
  4. Peters, M., Timmerhaus, K. (1991). Plant Design and Economics for Chemical Engineers. McGraw-Hill.

SarjeRao Chopade

Lead Engineer at Aramco

1 年

Emad ElGebesy (M.Sc MIChemE C.Eng) Very informative, thanks for sharing

Philip Black, P.E.

Do you know about the hidden acquisition conversations that could derail your career? I'm happy to share them with you!

1 年

Very informative!

Noah Tibasiima REng

Oil & Gas | Strategy & Business | Consulting

1 年

Couldn’t be more informed. Thanks for the read Emad ElGebesy (M.Sc MIChemE C.Eng)

Jant Erbert Garboso, AMIChemE

Process Design Engineer / Technical Writer / Lecturer

1 年

Good read. Thank you for posting Emad ElGebesy (M.Sc MIChemE C.Eng)

Mahmoud Abo Elenen

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 ??

要查看或添加评论,请登录

社区洞察

其他会员也浏览了