AWS for Industries

The challenge of daily field operator dispatch

Oil and gas operators face a daily challenge determining where field technicians should spend their time to have the biggest impact on increasing production. Production-disrupting incidents happen randomly and can occur with any well on any given day. Additionally, planned preventive maintenance and mandatory inspections are continuously happening across the field, sometimes on the same wells that are suffering production issues.

Production field operators often manage many more wells than they can visit in a single day. Each day, they decide which wells to visit based on many factors, including changes in production volumes and the need to check locations for equipment health/tank levels and to prepare wells for workover rig operations. Well locations are often far apart, and many operators spend the majority of their workday driving between locations.

Operators look at each of their well’s production numbers every morning to see if they need to address problems such as an artificial lift device being off-line, separator dump valves clogging, and plunger lift wells logging off. The assets that oil and gas operators own are subject to various operational issues: pumping units have bearings that fail, plunger lift wells fill with water, gas lift wells have to be kicked off when compressors go down, and so on.

If an operator ignored well proximity and instead visited each well in order of production decrease, they would spend an unacceptable amount of their time driving each day. Optimizing the driving route based on production decrease and the driving time between wells creates a difficult problem. If an operator is assigned 70 wells, there are 70 factorial = ~10^100 different possible driving paths, more than the number of atoms in the universe! No human could optimally solve the routing problem in their head, so operators often visit wells on a schedule instead of choosing a driving route dynamically based on production information.

On the other hand, computers excel at solving complex optimization problems. Many open-source numeric solvers exist to address various use cases, including driving route optimization. By using specially designed heuristics, these solvers can quickly find optimized solutions. By combining human and machine intelligence, operators can get the most out of their assets.

Optimized operator routing on AWS

This blog post will propose tools and techniques that can be used to solve the daily field dispatch problem. By incorporating the latest data points into an optimization algorithm, it is possible to determine how to get the most production back online while minimizing miles driven and hours worked. Additional factors like required inspections, turnaround completions, and safety considerations can be included and weighted according to changing business needs. With a robust cloud-based task prioritization algorithm, large inspection and calibration campaigns can be handled in-line with corrective maintenance, shortening the overall duration and effort. Complex what-if scenarios can be used to assess the trade-off between employing more operators and maximizing production for the biggest impact to the bottom line.

Amazon Web Services (AWS) provides several powerful cloud services that are well positioned to improve operational effectiveness for energy workloads that require many trips to work sites. Amazon Location Service is a fully managed service to integrate geospatial data into applications. Operators can use asset and fleet tracking, geocoding, reverse-geocoding, geofences, and industrial truck driving directions optimized for either time or distance. You can use the service to integrate location data into programs written in Java, Go, PowerShell, Node.js, C#, or Python and run them as serverless code using AWS Lambda (a serverless, event-driven compute service) or packaged and deployed as container images.

The described approach and code sample in this blog post show how to build a workload that recommends the route that each operator can drive to optimize their well visits based on recent production decreases.

Each morning, the operator receives a recommendation of which wells to visit that day. The operator can use this recommendation to inform which wells to visit while considering other priorities besides production optimization, such as equipment maintenance and preparing wells for workovers. You can customize this code sample to include constraints, such as the operator needing to visit every well each month, or include other metrics in the value of visiting a well, such as indications of problems with an artificial lift system.

Solution details

Optimizing driving routes is difficult for humans, but not for computers. The code sample in this blog post shows how to use driving time between wells from Amazon Location Service and production numbers to calculate an optimized route using a numerical solver run in a serverless Lambda function.

The solution produces optimal driving routes using the following steps:

1. Information about the locations of wells on a route is stored in Amazon DynamoDB, a serverless, NoSQL database service.

2. Each morning, the operator loads a webpage served using Amazon API Gateway, a fully managed service that developers use to create, publish, maintain, monitor, and secure APIs at any scale. Loading this website will call a Lambda function.

3. The Lambda function queries production data for a given route to find each well’s production change, and it queries the Amazon Location Service CalculateRouteMatrix API to find the driving time between each pair of wells.

4. The Lambda function uses the production decreases and driving time between wells to find an optimized path through the wells, which addresses the maximum production decrease while still having the operator back at home when their shift is over.

5. The Lambda function returns a website that shows the optimized route.

The diagram below shows how AWS services deliver this solution. Amazon API Gateway acts as the “front door” for users and applications to access data and business logic. A field operator routing optimizer method can be added to your company’s existing API offerings. Amazon Location Service calculates the time to drive between locations and returns directions to get there. Amazon DynamoDB stores each well’s geographic location.

Figure 1 This architectural diagram shows how AWS services interact to serve an optimized driving route to the production field operator

Figure 1: This architectural diagram shows how AWS services interact to serve an optimized driving route to the production field operator.

The Lambda function uses the OR-Tools library to solve this routing problem. The problem posed in this blog post involves visiting only the wells that maximize the volume of production impacted by the operator. To pose the problem in this way, assign a penalty to not visiting a well proportionate to the well’s production drop. The solver then knows to minimize the production drop of wells not visited, which is the same as maximizing the production drops that the operator addresses during their shift. To help the solver with this problem, give it an initial solution of visiting wells in order of production decrease, and keep driving time as part of the cost function. The latter is important so that the heuristic used by the solver can efficiently solve the problem.

In this code sample, we assign the operator 100 wells from San Juan Basin townships 30N-6W, 30N-7W, 29N-6W, and 29N-7W. When the operator loads the website, the Lambda function queries the operator’s wells and each well’s production numbers (here simulated by a random number generator). Each well is randomly assigned a daily production change between +50 and -50 barrels of oil equivalent per day (BOE/day). The function then calculates an optimized route through the wells, assuming that the operator stops 30 minutes at each well and communicates it to the operator using a map plot. The operator can now use this optimized route to inform the route they choose to drive that day.

To assess the impact of using an optimized route, we can compare the production drops that an operator would address if they visited each well in order of production decrease, with that of an optimized driving route. In this example, the cumulative production drop that the operator effects is usually 20–50 percent higher by driving an optimized route through the wells.

Figure 2 information they need to maximize production from their wells

Now, the operator has the information they need to maximize production from their wells. Giving them a table with production changes of each well doesn’t solve the problem of which order to visit wells that day. Taking advantage of numeric solvers helps the operator increase production and plan out maintenance tasks like gauging tank levels.

Deploy the code sample

You can deploy this code sample using the AWS Serverless Application Model (AWS SAM), an open-source developer tool for building and running serverless applications on AWS. The AWS SAM Developer Guide includes installation instructions. Install Docker to use a container to build the code sample.

1. git clone https://github.com/aws-samples/optimize-production-field-operator-routing-on-aws

2. cd optimize-production-field-operator-routing-on-aws

3. sam build --use-container

4. sam deploy --guided

After deploying the code sample, you will see a console output similar to the screenshot below.

Figure 3 Load the AWS CloudFormation an infrastructure-as-code provisioning tool output WebEndpoint in an internet browser

Load the AWS CloudFormation (an infrastructure-as-code provisioning tool) output WebEndpointin an internet browser to see an example of an optimized driving route recommendation.

Summary

In this blog post, we have explored the daily challenges faced by energy operators who are planning and running jobs to maximize production while minimizing cost and risk. The operators who optimize driver routing will see higher and more stable production rates, as well as reduced well visits with no meaningful action, and they will also help field operators to more easily switch routes.

AWS simplifies the solution by providing fully managed cloud-based services to assess, plan, and enact an optimized daily operations schedule. This solution can be extended beyond a static once-daily gain for a single worker, to a fully integrated mobile application that optimizes all operators’ driving routes throughout the day as conditions change. Optimally navigating operators across the entire field drives more efficiency gains than limiting each to their assigned wells. Mobile applications and navigation inside work trucks lets you make intraday adjustments, and incorporating all wells and technicians results in a novel way to get the most out of your field. In an industry that continues to demand more with less, operations teams can use AWS to focus on prioritizing the sequence of response, removing the guesswork and confusion from daily planning.

Scott Bateman

Scott Bateman

Scott Bateman is an AWS Principal Solutions Architect with over 25 years of technical experience in all segments of the energy industry. As a specialist in geospatial energy concepts, Scott works to define and build cloud-based solutions for energy & utilities customers to accelerate time to value on AWS.

Walt Mayfield

Walt Mayfield

Walt Mayfield is a petroleum engineer and AWS Solutions Architect with over 10 years of technical experience designing, building and operating both physical and digital upstream oil and gas assets. As a specialist in machine learning, analytics, and IoT, Walt helps energy companies use AWS to maximize the value of assets at the edge. Outside of work he likes to garden, fly fish and parent.