Changes on Pipesim Python Toolkit API between versions are necessary for either enhancements or bug fixes. This section describes the changes that may affect the scripts that are created with previous versions of Python Toolkit.
Added emulsion viscosity parameters for MFL and Compositional fluids, including:
Parameters.MFLFluid.LIQUIDVISCOSITYCALCParameters.MFLFluid.USERWATERCUTCUTOFFParameters.MFLFluid.USEBRAUNERULLMANEQUATIONParameters.MFLFluid.VANDUSERK1Parameters.MFLFluid.VANDUSERK2Parameters.MFLFluid.RICHARDSONKOIWParameters.MFLFluid.RICHARDSONKWIOParameters.MFLFluid.USEREMULSIONTABLEParameters.CompositionalFluid.USEREMULSIONTABLE
Added Constants.EmulsionViscosityMethod.KENDALLMONROE emulsion viscosity method.
The set_mix_viscosity_table, get_mix_viscosity_table, and delete_mix_viscosity_table methods now support MFL and Compositional fluids in addition to BlackOil fluids.
The fluid type is now automatically detected when passing a fluid name directly, without requiring an explicit fluid type keyword (e.g., CompositionalFluid= or MFLFluid=).
See examples\get_set_mfl_fluid.py, examples\get_set_blackoil_mix_viscosity_table.py, examples\get_set_mfl_mix_viscosity_table.py, and examples\get_set_compositional_mix_viscosity_table.py
Added support for the new OLGAS 2026.1 flow correlations:
Constants.MultiphaseFlowCorrelation.OLGAS.OLGAS20261_3PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGAS20261_3PHASEHDConstants.MultiphaseFlowCorrelation.OLGAS.OLGAS20261_2PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGAS20261_2PHASECO2
See examples\get_set_flow_correlations.py
The Well Calibration simulation task is now supported. This task enables automated calibration of well models against measured field data.
See examples\well_calibration.py, well_calibration_publish.py, well_calibration_set_calibration_parameters.py well_calibration_reset_boundary_conditions.py, and well_calibration_add_delete_test.py
Improved error handling when opening a model fails. The error message now clearly indicates the reason for the failure, such as when opening a corrupted project or an unsupported old version project.
Exposed the “ESP slippage factor” simulation setting. Use Parameters.SimulationSetting.ESPSLIPPAGEFACTOR.
Constants.GasCompressCorrelation.ROBINSONETAL
Parameters.BlackOilFluid.SinglePointCalibration.OILFVFCORRELATION
Constants.OilFVFCorrelation
Constants.MultiphaseFlowCorrelation.BakerJardine.BEGGSBRILL
Constants.MultiphaseFlowCorrelation.BakerJardine.DUKLER
To select Dukler correlation use Constants.MultiphaseFlowCorrelation.TulsaLegacy.DUKLER
Updated Seaweed shapefile utility and some example scripts to use Plotly instead of Matplotlib for plotting.
See examples\get_OneSubsea_multiphase_booster_results.py
Support spot report results.
The following reports are now supported:
Composition details
Stock tank fluid properties
Flowing fluid properties
Cumulative values
Multiphase flow values
Slugging values
Pigging values
Heat transfer values
See examples\get_spot_report_results.py
Changing the well type to advanced is now supported.
>>> model.set_value(context=<well_name>,
parameter=Parameters.Well.TYPE,
value=Constants.WellType.ADVANCED)Added new class for setting the well tubing type.
Use: Constants.TubingConfiguration
See examples\advanced_well_set_type.py, advanced_well_single_string.py, advanced_well_dual_string.py, advanced_well_concentric.py
Changing the well tubing configuration is now supported.
>>> model.set_value(context=<well_name>,
parameter=Parameters.Well.TUBINGCONFIGURATION,
value=Constants.TubingConfiguration.SINGLESTRING)Adding tail pipe is now supported.
See examples\advanced_well_tail_pipe.py.
Adding downhole equipment to the advanced well is now supported.
See examples\advanced_well_single_string.py, advanced_well_dual_string.py, advanced_well_concentric.py
Changing the tubing string for downhole equipment in advanced well is now supported.
See examples\advanced_well_dual_string.py.
Advanced well solver tolerance is now supported.
Use: Parameters.SimulationSetting.ADVANCEDWELLTOLERANCE
See examples\systemperformance_flowcontrolvalve_result.py.
Tubing head fluid temperature is now supported.
Use:Parameters.Well.HeatTransfer.TUBINGHEADFLUIDTEMPERATURE Parameters.Well.HeatTransfer.LONGTUBINGHEADFLUIDTEMPERATURE Parameters.Well.HeatTransfer.SHORTTUBINGHEADFLUIDTEMPERATURE
See examples\advanced_get_set_tubing_head_temperature.py.
Gaslift tuning factor is now supported.
Use: Parameters.GasLiftInjection.TUNINGFACTOR
See examples\advanced_get_set_gaslift_tuning_factor.py.
Gaslift injection through property is now supported.
Use: Parameters.Well.ISINJECTIONTHROUGHOUTERTUBING
See examples\advanced_well_concentric.py.
Connection on Advanced well is now supported.
Added new class for setting the advanced well port.
Use: Constants.Connection.AdvancedWell
See examples\connect_disconnect.py.
Setting wellstreams and wellstream properties for advanced wells are now supported.
Use:Constants.Wellstream.TOP
Constants.Wellstream.MIDDLE
Constants.Wellstream.BOTTOM
>>> set_wellstream(Well=<well_name>,
port=Constants.Wellstream.TOP,
surface_component_name="FL_long_2")See examples\advanced_get_set_wellstream.py.
Use:Parameters.SimulationSetting.MAXEMULSIONINVERSIONWATERCUT
See examples\get_set_simulation_settings.py.
Constants.MultiphaseFlowCorrelation.OLGAS.OLGASV731_3PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGASV731_2PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGASV72_3PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGASV72_2PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGASV627_3PHASEConstants.MultiphaseFlowCorrelation.OLGAS.OLGASV627_2PHASE
Added new classes:Constants.UndersaturatedOilFVFCorrelation for Oil FVF (above BP).
Constants.LiveOilFVFCorrelation instead of Constants.OilFVFCorrelation to be aligned with UI.
Added new members in class Parameters.BlackOilFluid.SinglePointCalibration:UNDERSATURATEDOILFVFCORR for Oil FVF (Above BP).
LIVEOILFVFCORRELATION instead of OILFVFCORRELATION.
Added new member in class Constants.GasCompressCorrelation:DRANCHUKROBINSON instead of ROBINSON to be aligned with UI.
The following classes and members are deprecated and must be replaced:Parameters.BlackOilFluid.SinglePointCalibration.OILFVFCORRELATION
Constants.OilFVFCorrelation
Constants.GasCompressCorrelation.ROBINSON
Check examples\create_blackoil_fluid.py for creating a black oil fluid with the new parameters.
Use:Constants.OneSubseaBoosterModel.HX330_350_200
Constants.OneSubseaBoosterModel.HX330_450_200
Constants.OneSubseaBoosterModel.HX330_550_200
Constants.OneSubseaBoosterModel.HX330_650_200
Constants.OneSubseaBoosterModel.HX330_800_200
Constants.OneSubseaBoosterModel.HX330_1000_200
Constants.OneSubseaBoosterModel.HX330_1200_200
Constants.OneSubseaBoosterModel.HX330_1400_200
Use:SystemVariables.MINIMUM_MAOP
SystemVariables.MAXIMUM_MAOP_RISK
SystemVariables.MAXIMUM_MAOP_RATIO
ProfileVariables.MAOP
ProfileVariables.MAOP_RATIO
ProfileVariables.MAOP_RISK
Use:Constants.MultiphaseFlowCorrelation.TUFFPUnified.TUFFPV2024_3PHASE
Use:Parameters.Boundary.BOUNDARYNODENAME
Parameters.Boundary.BOUNDARYNODETYPE
Parameters.Boundary.WELLNAME
Parameters.Boundary.ISACTIVE
Boundary condition operations (get/set/reset) and task simulation(run/start) are supported for advanced well.
See examples\systemperformance_dual_string.py and systemperformance_concentric_tubing.py
FetkovitchEquationModel class is deprecated and should be removed from your code. The new class IPRFetkovitch is being introduced to align with other IPR classes.
Use:Parameters.IPRFetkovitch.ABSOLUTEOPENFLOWPOTENTIAL
Parameters.IPRFetkovitch.NEXPONENT
ASTER and SRTM elevation data sources are removed in 2024.3. ESRI data source is used in elevation capture. Constants.ElevationSource, Constants.GisElevationDataSource and Parameters.SimulationSetting.GISELEVATIONSOURCETYPE are deprecated and should be removed from your code.
Use:SystemVariables.NODAL_POINT_VOLUME_FLOWRATE_OIL_STOCKTANK
Parameters.NodalOperatingEnvelopePlot.OILFLOWRATE
Parameters.NodalOperatingEnvelopePlot.OILFLOWRATEPRESSURE
See examples\nodal_sim_run_simulation.py
Class name for sixgill\ErrosionCorrosionRiskIndexLimits was changed to sixgill\ErosionCorrosionRiskIndexLimits
examples\get_set_errosion_corrosion_risk_limits.py was renamed to examples\get_set_erosion_corrosion_risk_limits.py.
Use: SystemVariables.HEEL_FLOWING_GAS_FLOWRATE_STOCKTANK and SystemVariables.PCP_TORQUE
See examples\get_set_flow_control_valve_generic.py and get_set_flow_control_valve_specific.py.
See examples\get_set_using_component.py.
SystemVariables.ROD_PUMP_INTAKE_PRESSURE
SystemVariables.ROD_PUMP_INTAKE_VOLUMETRIC_FLOWRATE_FLUID
SystemVariables.ROD_PUMP_INTAKE_VOLUME_FRACTION_GAS
SystemVariables.ROD_PUMP_INTAKE_VOLUME_FLOWRATE_LIQUID
SystemVariables.ROD_PUMP_INTAKE_VOLUME_FLOWRATE_FREE_GAS
SystemVariables.ROD_PUMP_DISCHARGE_PRESSURE
SystemVariables.ROD_PUMP_POWER
SystemVariables.ROD_PUMP_DELTA_PRESSURE
SystemVariables.ROD_PUMP_EFFICIENCY
SystemVariables.BRANCH_DELTA_PRESSURE(useSystemVariables.SYSTEM_PRESSURE_LOSSinstead)
SystemVariables.CHOKE_DELTA_PRESSURE(useSystemVariables.PRESSURE_DIFFERENCEinstead)
SystemVariables.EROSIONAL_VELOCITY_RATIO_MAXIMUM(useSystemVariables.MAXIMUM_EROSIONAL_VELOCITY_RATIOinstead)
SystemVariables.VELOCITY_GAS_MAXIMUM(useSystemVariables.MAXIMUM_VELOCITY_GASinstead)
SystemVariables.VELOCITY_LIQUID_MAXIMUM(useSystemVariables.MAXIMUM_VELOCITY_LIQUIDinstead)
SystemVariables.PRESSURE_AT_NODAL_ANALYSIS_POINT(useSystemVariables.NODAL_POINT_PRESSUREinstead)
SystemVariables.VELOCITY_GAS
SystemVariables.VELOCITY_LIQUID
SystemVariables.VELOCITY_MEAN
SystemVariables.VELOCITY_MEAN_MAXIMUM
In 2022.2, the INLET_TEMPERATURE system variable is used to report system inlet temperature. In 2023.1, a new variable SYSTEM_INLET_TEMPERATURE is added to align with the user interface. The INLET_TEMPERATURE is deprecated and should be replaced with new one in your python code. It will be removed in future Pipesim releases.
Use:ProfileVariables.GAS_WALL_SHEAR_STRESS
ProfileVariables.OIL_WALL_SHEAR_STRESS
ProfileVariables.WATER_WALL_SHEAR_STRESS
ProfileVariables.LIQUID_WALL_SHEAR_STRESS
See examples\networksim.py.
Use: SystemVariables.SPHERE_TIME_IN_PIPELINE
Use: SystemVariables.TOTAL_MOVING_LIQUID_VOLUME and SystemVariables.TOTAL_STATIC_LIQUID_VOLUME
See examples\nodal_sim_multipoint.py and ptprofilesim_multipoint.py
See examples\get_set_user_mix_viscosity_table.py.
Use: ProfileVariables.SEVERE_SLUGGING_INDICATOR_POTS
See examples\get_set_user_viscosity_table.py.
Many packages are updated to latest version, for example requests and rdflib.
Starting from requests version 2.26.0, NaN is not allowed, and Pipesim converted NaN to None. As result of this change, you may see None is used instead of NaN in previous versions.
The new Python Toolkit environment based on Anaconda Python distribution replaced Enthought Canopy.
Some API methods may throw an exception “sixgill.core.model_context:’’ is not a valid context value.” when there are empty names in the project. In the new release, we changed the exception to a warning instead.
See examples\vfp_tables_simulation_with_sensitivities.py and get_set_vfp_tables_conditions.py.
model_settings.corrosion_limits. It will be removed in future releases. Use model_settings.corrosion_model_dewaard.corrosion_limits instead.
See examples\get_set_corrosion_model.py and get_set_erosion_corrosion_risk_limits.py.
See examples\multiprocessing_run_simulation_parallel.py and multiprocessing_run_simulation_seq.py.
Parameters.WellPerformanceCurvesSimulation.SENSITIVITYVARIABLE. It will be removed in future releases. Use Parameters.WellPerformanceCurvesSimulation.SensitivityVariable instead.
See examples\nodal_sim_run_simulation_sensitivities.py and get_set_nodal_sim_sensitivites.py
These variables have been reported as fraction. The issue has been fixed now. Some of the variables impacted by this change are:
Efficiency(ESP, PCP, Rod pump, …) ESP intake gas volume fraction Flowing watercut at nodal analysis point Volume fraction liquid at inlet …
See examples\well_export_all.py An additional optional parameter has been added to export_well method of the Model. This parameter is called well_names, which is a list of the well names.
See examples\well_import_all.py A new method called import_wells has been added to Model. Example:
>>> model.import_wells("C:/Data/MyFolder")A proper message is displayed if the Pipesim file’s version is not supported by the installed Pipesim application.
delete_sensitivities should be used instead. The delete_sinsitivities methods will be removed in a future release.
GasLift.DiagnosticsOperationThrottling.AUTO. It translates to “On” for compatibility and will be removed in future releases.
In 2019.2 the single branch simulations(PtProfile, System analysis, well curves, Gaslift diagnostics) support a new method called delete_sensitivities(). This method clears all the sensitivity data for the specified simulation task.
There is also support for clearing individual sensitivities(this feature was supported by some simulation tasks, but now it is supported by any task that supports sensitivity).
To clear individual sensitivity data, pass an empty dictionary to the method.
Example: The following code snippet demonstrates how to clear the X sensitivity and define the first variable sensitivity at the same time:
>>> parameters = {
Parameters.SystemAnalysisSimulation.SENSITIVITYVARIABLES:
[
{},
{
Parameters.SystemAnalysisSimulation.SensitivityVariable.COMPONENT:"VertComp",
Parameters.SystemAnalysisSimulation.SensitivityVariable.VARIABLE:Parameters.Completion.RESERVOIRPRESSURE,
Parameters.SystemAnalysisSimulation.SensitivityVariable.VALUES:[2000,3000,4000] #psia
}
],
}
>>> self.model.tasks.systemanalysissimulation.set_conditions("Well",parameters)A RuntimeError of “can’t start new thread” has been fixed that occurred when opening many models.
In 2019.2, after Visual Studio Code is installed, it will be set as default code editor when you work with Excel workbook.
In 2019.1, a new parameter is added to the Model.Save() method to save a model by specifying a perspective:
>>> model.save("C:/Temp/MyModel.pips",ViewTypes.WELL)
>>> model.save("C:/Temp/MyModel.pips",ViewTypes.NETWORK)Four new properties, InnerDiameter, Length, Roughness and WallThickness are returned when Model.get_values() is called for a flowline:
>>> model.get_values(Pipe='FL-3')Tow deprecated parameters, CLUSTEREDLATITUDE and CLUSTEREDLONGITUDE, are removed. They should be replaced with NONCLUSTEREDLATITUDE and NONCLUSTEREDLONGITUDE. See release notes in 2017.2 for details.
Four parameters, Parameters.GLDiagnosticsSimulation.BoundaryConditions.RESRVOIRPRESSURE, Parameters.GLDiagnosticsSimulation.BoundaryConditions.RESERVOIRTEMPERATURE, Parameters.GLDiagnosticsSimulation.BoundaryConditions.GOR, and Parameters.GLDiagnosticsSimulation.BoundaryConditions.WATERCUT, are deprecated. They should be replaced with Parameters.Boundary.PRESSURE, Parameters.Boundary.TEMPERATURE, Parameters.Boundary.GOR and Parameters.Boundary.WATERCUT. These four parameters are generic for any operations, and they are not Gas lift diagnostics specific. The old parameters will be removed in a future release.
In 2018.1, The environment variable is no longer in use. You can enable the “restart”, “Generate engine output files” and “Number of cores to use for simulation” options directly in the run command of the simulation:
>>> model.tasks.networksimulation.run(system_variables=get_system_variables(),
profile_variables=get_profile_variables(),
study = "Study 1",
options={SimulationOptions.RESTART:False,
SimulationOptions.GENERATEOUTPUTFILE:True,
SimulationOptions.PARALLELISM:2})In 2017.1, two parameters: CLUSTEREDLATITUDE and CLUSTEREDLONGITUDE, are used to define the non-cluster location in GIS canvas, which displays equipment when cluster checkbox is toggled off in UI. In 2017.2, two new parameters: NONCLUSTEREDLATITUDE and NONCLUSTEREDLONGITUDE, are added to reflect their true meanings. The old parameters are deprecated and should be replaced with new parameters in your python code. The old parameters will be removed in Pipesim 2018.1
In 2017.1, junction name is changed when it is converted to a well, source, or sink. Although it is the same behavior as Pipesim UI, it may cause inconveniences in subsequent user’s code. In 2017.2, the new equipment converted from junction will have the same name and user can set it to a desired name by using (assuming that junction is converted to a source)
>>> model.set_value(Source=<junction_name>,
parameter="Name",
value=<new_name>)In 2017.1, Pipesim defines POWER that represents power for one unit. In 2017.2, Pipesim defines TOTALPOWER that represents total power for all parallel units, to be consistent with OneSubsea Wet Gas Compressor. The parameter POWER is deprecated and should be replaced with TOTALPOWER, and the value should be replaced by the (POWER * number of units) when setting the value. The parameter POWER will be removed in Python Toolkit 2018.1.
Pipesim UI has an option to Run or Restart a network simulation. When Restart is clicked, the results in the restart file captured from previous run can be reused clicked, the results in the restart file captured from previous run can be reused as initial estimates for a subsequent simulation run. Restart can improve the network solving speed significantly and is most effective when running many similar scenarios with only small variations. However, if network topology changes, such as new pipes added, wells added/deleted, well or source activated/deactivated, Run and Restart may converge to different solutions, so it should be used with caution.
In 2017.1, when running a network simulation in Python Toolkit, Restart is always used for subsquent runs if a restart file is available or is saved with the model. In 2017.2, the default option is changed to Run from scratch. If Restart option is desired to improve the speed of subsquenct network simulation runs, you can enable this setting by adding an environment variable in your python code:
>>> import os
>>> os.environ['UseRestartFile'] = "true"