소스 정보
- 저장소
- kucherenko/petropowers
- 최근 소스 활동
- 2026년 4월 6일 08:19
- 감지된 SKILL.md 언어
- 영어
- 스타
- 10
- 포크
- 4
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/kucherenko/petropowers --skill midstream명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
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: