PIPESIM Python Toolkit 系列(8):数据表操作——井轨迹与管线几何数据处理

云智设计
云智设计
云智设计
编辑
140
文章
0
粉丝
软件教程评论24阅读模式

PIPESIM 中的井轨迹(Trajectory)、管线几何(Geometry)和地温剖面(Geothermal Profile)等属于表格型数据。PTK 使用 pandas DataFrame 作为这类数据的载体,使得数据读取、处理和回写变得异常便捷。

PIPESIM Python Toolkit 系列(8):数据表操作——井轨迹与管线几何数据处理

读取管线几何数据

# 通过上下文路径
df = model.get_geometry(context="F_10")
# 或通过名称
df = model.get_geometry(Name="F_10")

返回的 DataFrame 包含测量深度(MD)、高程(Elevation)、X/Y 坐标等列。文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html

读取井轨迹

traj = model.get_trajectory(Name="GI_Well")
# DataFrame 列: MD, TVD, Inclination, Azimuth, X-offset, Y-offset

读取地温剖面

geo = model.get_geothermal_profile(Name="F_10")

设置数据表

将修改后的 DataFrame 写回模型:文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html

model.set_geometry(context="F_20", dataframe=df)

关键要求:写回的 DataFrame 必须与 get_geometry()列名一致,且索引从 0 开始。文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html

读取 P-Q 曲线(Source/Sink)

pq = model.get_pq_curve(Source="SRC1")
# DataFrame: Pressure, FlowRate

实战应用

典型的自动化场景:从 Excel 或 CSV 文件中读取测量数据,转换为 DataFrame 后批量写入管线几何。然后用 get_geometry() 验证写入结果。文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html

import pandas as pd
# 从 CSV 读取管线坐标
csv_data = pd.read_csv('pipeline_data.csv')
# 写入模型
model.set_geometry(context="FL_NEW", dataframe=csv_data)
# 验证
verify = model.get_geometry(context="FL_NEW")
print(verify.head())

这种方式特别适合处理来自 GIS 系统、测量队的管线数据导入。文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html 文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/26912.html

云智设计应力分析服务

客服微信
扫一扫
weinxin
EngGPT
微信号已复制
云智微信公众号
扫一扫
weinxin
cidrg_com
公众号已复制
 
云智设计
  • 本文由 云智设计 发表于2026年6月6日 17:35:41
  • 本站原创文章转载请注明文章出处及链接,谢谢合作!
匿名

发表评论

匿名网友
确定

拖动滑块以完成验证