PTK 的最大优势之一是能够通过代码动态构建和修改 PIPESIM 模型。本文将详细讲解组件的添加、删除操作,以及如何在创建时直接设定参数。
添加基本组件
添加一个 Source:文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html
from sixgill.definitions import ModelComponents
model.add(component=ModelComponents.SOURCE, name='Src1')添加一个 Sink(出口):文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html
model.add(ModelComponents.SINK, 'Outlet1')添加带参数的设备组件
添加油嘴并设定参数——在井 Well 2 中插入深度 500ft、Bean Size=2/64 inch 的油嘴:文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html
from sixgill.definitions import Parameters, Constants
model.add(
ModelComponents.CHOKE,
'CK1', context="Well 2",
parameters={
Parameters.Choke.TOPMEASUREDDEPTH: 500,
Parameters.Choke.BEANSIZE: 2,
Parameters.Choke.SUBCRITICALCORRELATION:
Constants.SubCriticalFlowCorrelation.ASHFORD
})添加井下设备(ESP)
在指定井下深度插入电潜泵:文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html
model.add(
component=ModelComponents.ESP,
name="ESP1",
context="Well 2",
parameters={
Parameters.ESP.TOPMEASUREDDEPTH: 1500,
Parameters.ESP.OPERATINGFREQUENCY: 60,
Parameters.ESP.MANUFACTURER: "ALNAS",
Parameters.ESP.MODEL: "ANA580",
Parameters.ESP.NUMBERSTAGES: 100,
Parameters.ESP.HEADFACTOR: 1,
Parameters.ESP.POWERFACTOR: 0.95,
Parameters.ESP.USEVISCOSITYCORRECTION: True
})添加油管段
model.add(
component=ModelComponents.TUBING,
name="ShortTub",
context="Well 2",
parameters={
Parameters.Tubing.TOPMEASUREDDEPTH: 0,
Parameters.Tubing.LENGTH: 4000,
Parameters.Tubing.INNERDIAMETER: 2.992,
Parameters.Tubing.ROUGHNESS: 0.001,
Parameters.Tubing.TUBINGSECTIONTYPE:
Constants.TubingSectionType.SHORTTUBING
})删除组件
model.delete(Name='Src1') # 按名称删除
model.delete(context='Well_2:ESP1') # 按路径删除删除井时会同时删除井下所有子组件。操作前建议先用 find() 确认上下文范围。文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html 文章源自云智设计-https://www.cidrg.com/cid-college/tutorial/pipesim/26889.html

客服微信
扫一扫

EngGPT
微信号已复制
云智微信公众号
扫一扫

cidrg_com
公众号已复制



