How to restart your plant faster from an unplanned shutdown
By: Suradech Kongkiatpaiboon
Tags: Data Science, Process Improvement, Anomaly Detection, Clustering, Oil And Gas

Anomaly Detection Technique

How to restart your plant faster from an unplanned shutdown

2 useful data science ways to find the root causes of unplanned shutdown cases in an oil and gas processing plant Suradech Kongkiatpaiboon Dec 21, 2020·7 min read

For any oil and gas plants, the owners do not normally want any shutdown cases to happen. Millions of dollars can be simply lost when the shutdown is prolonged. Unfortunately, this is usually unavoidable as there is a lot of processing equipment and instrument that could fail without notice. Operation and maintenance engineers are required to stay late at night to find the root cause of plant failure and to bring the plant back online as soon as possible.

Image from freepik.com

This process sometimes takes from a few days up to weeks before the real root causes can be identified and solved. Accelerating this process by just a few hours or days will definitely increase the revenue for the owners significantly.

To illustrate the feeling of how engineers solve the problem, let’s look at below synthetic data for just 20 sensors. In this graph, there are two sensors that are related strongly and statistically, and let’s say one of them is the real root cause of the shutdown events.

Synthetic data to simulate plant sensors

Sadly, by looking at the graph, it is difficult to find which of them are the right two related, right? As there are up to 1,000 — 3,000 sensors in a small oil and gas plant, this is one of the real pain points for operation and maintenance engineers (including myself) to identify such sensors and root causes. Remember that millions of dollars can be saved if we can find such relationships sooner.

Two statistically related sensors from the other 20 normal sensors

I’m going to share two techniques that we have tried and found an acceptable success rate to identify the relationship between these two related sensors among the others. Before that, let me explain why this is important for engineers and operators to look at.

First, for any shutdown event in a modern oil and gas plant, there will be a sophisticated control system in the control room that can show “First lock-out tag”. This “First lock-out tag” is the sensor tag that triggers the shutdown event (e.g. pressure alarm high-high at compressor discharge, level alarm low-low at a critical separator).

This first lock-out sensor is very important for operation and maintenance engineers to start looking at to see what are the potential root causes that trigger the plant shutdown. In most cases, the engineers and operators can solve the plant shutdown by just looking at this first lock-out tag. However, in many cases, it does not tell us much as the oil and gas processing is so complicated such that this first lock-out tag is the last action, while we want to know what happened before it triggers.

Once we know the first lock-out sensor and the time period before the shutdown event, we can use them to perform a clustering technique to identify which sensors behave in the same way as the first lock-out sensors. We feel that the hierarchical clustering technique and dendrogram creation is a useful visualization method that can communicate with non-data science users. An example of the result is shown in the below picture.

Clustering Dendrogram from hierarchical clustering technique

This technique is not only useful for finding the root cause of the unplanned shutdown case, but it can also be used to find any related sensors that behave differently from the normal condition. For example, let’s say if the sensor TI2335 shows an unknown increase in temperature of a suction scrubber and we want to find out what is the root cause of this abnormal increase. We can use this technique to find the related sensors to look at. Instead of looking at 1,000–3,000 sensors, the engineers can focus only on the sensors that locate close to the abnormal sensors or first lock-out sensors. Then, the troubleshooting time can be greatly reduced. Unfortunately, this technique does not suit well for all cases. Therefore, we have tried some other techniques.

Sir Clive Granger in 2008 (Image from wiki)

Granger’s causality test is a statistical hypothesis test for determining whether one set of time series data is useful in forecasting another. It is published by Sir Clive Granger in 1969 and he received a Nobel prize for his work in 2003.

When an economist collects statistical data and turns them into variables, one common problem arises. He cannot identify which variable is the independent variable and which one is the dependent variable. In other words, we do not know which factor causes the other factor.

A more tangible example is when economists try to find the relationship between Gross Domestic Production (GDP) and the stock index. When the country’s economy is good, GDP will also be good and the stock index will also be good. When the country’s economy is bad, GDP will be bad and the stock index will also lower. However, which one causes another one. Some people thought that GDP should be the independent variable as it reflects the real domestic production and consumption. On the other hand, some believe that the higher the stock index value, the more investors will invest in the country’s economy as it is one of confidentiality that the investors always look at. This problem leads to a totally different financial strategy for the country - whether to put the money to boost the ground-level economy or the stock market.

Granger’s causality test (wiki)

Sir Granger can come up with a statistical way to test this problem whether one variable has an impact on another variable or not, and the impact is one direction or two directions, so he got a Nobel prize for it. When there is such a problem, some may use this test to test other weird problems such as finding whether hens or eggs were born before in Thurman and Fisher’s paper (1988).

Though our problem is not as weird as the above one when I’ve tried using Granger’s causality test to our problem. That is, using this test to screen out some unrelated sensors and rank the related sensors by using the resulting p-value. The result is quite satisfactory for a group of process parameters.

Next, to generate a useful GUI to interact with no coding skills users, we’ve used the Gradio library and create a beautiful graphic for the prototyping phase.

In summary, from what I’ve tried so far, the hierarchical clustering functions well with the gas processing part, while Granger’s causality test works well for the liquid processing part. One of the reasons is that, in the liquid process, the nature of incompressible fluid usually takes time before the sensors can respond to process change. This is not true in the gas phase.

Lastly, this work cannot be completed without the support of my team members and some rewards from Chevron to drive me to work during the night time. I’ve really enjoyed applying data science techniques to solve real-world oil and gas problems. If you have similar work and would like to connect with me, feel free to reach me via linked. Till next post.

We got a Silver award!!!

References (Some are in Thai but it is very educative):

Thurman, Walter N. ; Mark E. Fisher. (1988) “Chickens, Eggs, and Causality, or Which Came First?” American Journal of Agricultural Economics, Vol. 70, №2. (May, 1988), pp. 237–238.