用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kucherenko/petropowers --skill midstream命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Generate realistic synthetic oil & gas data (LAS well logs, SEG-Y seismic, core photos, time-series) with proper physical constraints for testing, demos, and training.
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
基于 SOC 职业分类
正在显示 SKILL.md
| name | midstream |
| description | 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")
else:
print(f"Normal operation: {discrepancy:.0f} bpd discrepancy")
def assess_corrosion_defect(depth_percent, length_in, diameter_in, smys_psi, maop_psi):
"""
Assess corrosion defect using ASME B31G (simplified)
Returns: safe operating pressure
"""
# Depth as fraction
d = depth_percent / 100
# If defect depth > 80% of wall, fail
if d > 0.80:
return 0 # Requires immediate repair
# Length parameter
L = length_in / math.sqrt(diameter_in)
# B31G (modified) calculation
# Simplified: safe pressure reduction
a = 0.893 * L / math.sqrt(diameter_in)
if L <= math.sqrt(diameter_in):
# Short defect
safe_pressure = maop_psi * (1 - 0.66 * d)
else:
# Long defect (more severe)
safe_pressure = maop_psi * (1 - 0.66 * d) / (1 + 0.66 * d**2)
return safe_pressure
# Example: 30% deep, 6" long corrosion in 12" pipe
safe_p = assess_corrosion_defect(
depth_percent=30,
length_in=6,
diameter_in=12,
smys_psi=35000,
maop_psi=1440
)
print(f"Safe operating pressure: {safe_p:.0f} psi")
print(f"MAOP: 1440 psi")
print(f"Status: { safe_p >= }")
import pandas as pd
from datetime import datetime, timedelta
class BatchTracker:
def __init__(self, pipeline_length_km, avg_velocity_mps):
self.pipeline_length = pipeline_length_km
self.avg_velocity = avg_velocity_mps
self.batches = []
def inject_batch(self, batch_id, product, volume_bbl, timestamp):
self.batches.append({
'batch_id': batch_id,
'product': product,
'volume': volume_bbl,
'inject_time': timestamp,
'position_km': 0,
})
def update_positions(self, current_time):
time_hours = [(current_time - b['inject_time']).total_seconds() / 3600
for b in self.batches]
for i, batch in enumerate(self.batches):
# Position = velocity * time
position = self.avg_velocity * 3.6 * time_hours[i] / 1000 # km
batch['position_km'] = min(position, self.pipeline_length)
def ():
[b b .batches b[] >= .pipeline_length]
tracker = BatchTracker(pipeline_length_km=, avg_velocity_mps=)
inject_time = datetime(, , , , )
tracker.inject_batch(, , , inject_time)
tracker.inject_batch(, , , inject_time + timedelta(hours=))
tracker.update_positions(inject_time + timedelta(hours=))
batch tracker.batches:
()
| KPI | Units | Target |
|---|---|---|
| Availability | % | >99% |
| Leak incidents | per 1000 km-yr | <0.5 |
| ILI compliance | % | 100% |
| On-time delivery | % | >98% |
| Energy efficiency | kWh/bbl | Minimize |
Pipeline safety critical areas: