Guide AI agents through pipeline transportation and storage operations.
Guide AI agents through pipeline transportation and storage operations.
Support pipeline engineers in ensuring safe and efficient hydrocarbon transportation and storage.
| Data | Source | Frequency |
|---|---|---|
| Flow rates | SCADA | Real-time (1-min) |
| Pressure | SCADA | Real-time (1-min) |
| Temperature | SCADA |
| Real-time |
| ILI (Inline Inspection) | Smart pig | 5-year cycle |
| Leak detection | CPM/DDS | Real-time (continuous) |
| Product quality | Lab | Batch/sample |
These tasks are handled by this skill:
These tasks invoke petropowers:oil-gas-delegation:
import math
def pressure_drop_liquid(flow_bpd, diameter_in, length_ft, viscosity_cp, density_api):
"""Calculate pressure drop for liquid pipeline (simplified)"""
# Convert units
q_bpm = flow_bpd / 1440 # bpd to bpm
d_ft = diameter_in / 12
# Velocity (ft/s)
area_sqft = math.pi * d_ft**2 / 4
velocity = q_bpm / 7.48 / area_sqft # ft/s
# Reynolds number
rho = 62.4 * (141.5 / (density_api + 131.5)) # lb/ft³
re = rho * velocity * d_ft / (viscosity_cp * 0.000672)
# Friction factor (Blasius for turbulent)
f = 0.079 / re**0.25 if re > 4000 else 64 / re
# Pressure drop (psi)
delta_p = 2 * f * (length_ft / d_ft) * rho * velocity**2 / (32.2 * 144)
return delta_p
# Example: 12" pipeline, 50,000 bpd, 100 miles
d_psi = pressure_drop_liquid(
flow_bpd=50000,
diameter_in=12,
length_ft=100 * 5280,
viscosity_cp=5,
density_api=35
)
print(f"Pressure drop: {d_psi:.0f} psi")
def detect_leak(flow_in, flow_out, pressure_in, pressure_out,
linepack_initial, linepack_current, tolerance=0.01):
"""
Simple mass balance leak detection
Returns: (is_leak, discrepancy)
"""
# Mass balance: In - Out = Linepack change + Leak
# In SCADA units: bpd
# Calculate linepack change
linepack_change = linepack_current - linepack_initial
# Discrepancy
discrepancy = flow_in - flow_out - linepack_change
# Threshold (as fraction of flow)
threshold = flow_in * tolerance
is_leak = abs(discrepancy) > threshold
return is_leak, discrepancy
# Example
flow_in = 50000 # bpd
flow_out = 49500 # bpd
linepack_initial = 10000 # bbl
linepack_current = 10050 # bbl
is_leak, discrepancy = detect_leak(flow_in, flow_out, 0, 0,
linepack_initial, linepack_current)
if is_leak:
print(f"LEAK DETECTED: {discrepancy:.0f} bpd discrepancy")