Automated hydraulic analysis with AI and QGIS

2026-11-15

Rapidly analyzing pipeline networks with AI-assistance.

Written by: Peter Maginot

There’s a vast amount of public information out there on oil and gas wells and pipelines, especially in Texas. The Texas Railroad Commisssion website has a wonderful GIS web application where you can go through and poke through the wells and pipelines anywhere in the state, seeing how each well is constructed and how the pipeline network gets its oil and gas to market. But how can you get this data on to your computer to take a closer look at it?

The RRC has a bulk data download site, which has GIS shapefiles for well and pipeline layers by county, as well as production data by gas well or oil lease (these especially are some massive files!) You can import these into your GIS software of choice and pore over it, tracing out the pipeline network, downloading production data to calculate flow through the pipeline system and estimate the hydraulics.

But that would take a really long time to set everything up to analyze even a simple system. Luckily, nowadays you can just have the computer do it! I’ve been practicing manipulating QGIS, an open source geospatial software package, through an LLM via an MCP connection. This allows you to just tell the computer what information you want to gather rather than poring through data manually. You can even have it run additional analyses on data by directing it to additional software packages that it can use.

Here’s an example of how you can use it. Say you wanted to evaluate the hydraulics in a gas gathering system. Let’s pick on this BPX gathering system in Karnes County. It’s quite a tangled web on the RRC’s GIS viewer, with no easy way to filter by operator.

BPX gathering area in RRC GIS

Well that’s a mess. We can make this far more legible by downloading the data to local GIS software and filtering by the operator of interest. A couple of prompts did exactly this.

BPX gathering area

That’s much more legible. I don’t know exactly how their gathering system works but I can make some educated guesses based on the publicly available info. There’s a few dozen well pads that feed what appears to be a compression/dehydration facility, with a complex gathering system that includes what appear to be a few segments that operate in parallel. There’s also a pipeline network labeled “Gas Lift”, giving a pretty good indication of the artifical lift method used here (aside from a handful of wells with rod pumps). I directed Claude to go through and identify which wells had rod pumps and label them green and label the rest (free flowing or gas lift) red. It got most of them right, and a quick review corrected a few that were wrong.

BPX gathering area

Here’s a prompt to do this.

I also had it figure out how each well was connected to a separation facility and the gathering system, as well as how all of the gathering lines connected to each other all the way to the central delivery point. A few corrections were necessary to fill in some missing data and clearly incorrect calls, but in a matter of less than an hour, we had the full gathering system modeled with how each well tied in to the gathering system and how the gathering system ran back the the central delivery point.

BPX gathering area

Another prompt started the gathering system hydraulics analysis. Here’s a prompt that would do this.

It went ahead and translated all of the GIS data on the line lengths, elevation profiles, network connection points, and flow rates into a network file that my hydraulics library could work with and ran it. I then had it create some pretty elevation and hydraulic profile plots so we could see what the pressures looked like at each well pad and gathering system node:

Hydraulic and elevation profiles
Dashed lines represent sections with parallel loop pipelines

and a simplified map showing the pressures and flow rates & directions to be expected through the system: Hydraulic map

Now, this is just a toy model that is the best we could do with the publicly available information. The pressures and flow rates are plausible for this sort of gathering system (although probably on the high side, it doesn’t look like there’s quite 80 MMSCFD worth of compression installed at the delivery point). If we had actual flow rate and pressure data, this would become a remarkably useful tool that we could use to identify spots where there may be pipeline obstructions, or predict the effect of changing operating parameters like compressor suction pressures, or compare the effect of tying new wells in to one side of the gathering system or another. We could also model options for debottlenecking, including the effect of new looping or parallel lines to decide if those projects would be worthwhile. There is enormous potential here to improve our ability to rapidly solve real problems, and I’m excited to experiment with it some more.

QGIS

CoolProp

Python

Hydraulics

AI in Engineering