Class TubingPerformance
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface
TubingPerformance class - Vertical Lift Performance (VLP) model for wellbore tubing.
This class calculates the pressure drop through wellbore tubing using various multiphase flow correlations. It can generate VLP curves (also known as Tubing Performance Curves or Outflow Performance Relationships) for use in nodal analysis and reservoir simulation.
Supported Pressure-Drop Correlations
- BEGGS_BRILL - General purpose, all inclinations (default)
- HAGEDORN_BROWN - Vertical/near-vertical oil wells
- GRAY - Gas wells with condensate
- HASAN_KABIR - Mechanistic model for all well types
- DUNS_ROS - Gas wells
Temperature Models
- ISOTHERMAL - Constant temperature throughout tubing
- LINEAR_GRADIENT - Linear temperature profile from BH to WH
- RAMEY - Ramey (1962) steady-state geothermal model
Usage Example - VLP Curve Generation
// Create reservoir fluid
SystemInterface fluid = new SystemSrkEos(373.15, 250.0);
fluid.addComponent("methane", 85.0);
fluid.addComponent("n-heptane", 15.0);
fluid.setMixingRule("classic");
fluid.setMultiPhaseCheck(true);
// Create wellhead stream
Stream wellStream = new Stream("well stream", fluid);
wellStream.setFlowRate(5000, "Sm3/day");
wellStream.run();
// Create tubing performance model
TubingPerformance tubing = new TubingPerformance("producer tubing", wellStream);
tubing.setTubingLength(2500.0, "m"); // True vertical depth
tubing.setTubingDiameter(0.1016, "m"); // 4-inch tubing
tubing.setWallRoughness(2.5e-5, "m");
tubing.setInclination(85.0); // 85 degrees from horizontal
// Set temperature model
tubing.setTemperatureModel(TubingPerformance.TemperatureModel.RAMEY);
tubing.setBottomHoleTemperature(100.0, "C");
tubing.setWellheadTemperature(40.0, "C");
tubing.setGeothermalGradient(0.03, "K/m");
// Generate VLP curve
double[] flowRates = {1000, 2000, 3000, 5000, 7000, 10000}; // Sm3/day
double[][] vlpCurve = tubing.generateVLPCurve(flowRates, "Sm3/day", "bara");
// vlpCurve[0] = flow rates
// vlpCurve[1] = bottom-hole pressures required
Integration with WellFlow (IPR-VLP Nodal Analysis)
// Create WellFlow for IPR
WellFlow ipr = new WellFlow("well IPR");
ipr.setInletStream(reservoirStream);
ipr.setVogelParameters(5000, 180, 250); // qTest, pwfTest, pRes
// Create TubingPerformance for VLP
TubingPerformance vlp = new TubingPerformance("tubing VLP", ipr.getOutletStream());
vlp.setTubingLength(2500, "m");
vlp.setTubingDiameter(0.1016, "m");
// Find operating point
double[] operatingPoint = vlp.findOperatingPoint(ipr, 50.0, "bara"); // WHP = 50 bara
// operatingPoint[0] = operating flow rate (Sm3/day)
// operatingPoint[1] = bottom-hole flowing pressure (bara)
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAvailable multiphase pressure-drop correlations.static enumTemperature profile models for wellbore heat transfer. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate double[]private doubleprivate doubleprivate double[]private doubleprivate static final org.apache.logging.log4j.LoggerLogger object for class.private intprivate doubleprivate double[]private doubleprivate static final longSerialization version UID.private double[]private double[]private doubleprivate double[]private doubleprivate doubleprivate doubleprivate booleanprivate double[]private double[]private double[]private doubleprivate doubleprivate doubleFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionTubingPerformance(String name) Constructor for TubingPerformance.TubingPerformance(String name, StreamInterface inletStream) Constructor for TubingPerformance with inlet stream. -
Method Summary
Modifier and TypeMethodDescriptionprivate doublecalculateBeggsBrillPressureDrop(SystemInterface fluid, double segmentLength) Beggs and Brill (1973) pressure drop calculation.private doublecalculateDunsRosPressureDrop(SystemInterface fluid, double segmentLength) Duns and Ros (1963) pressure drop - for gas wells.private doublecalculateFrictionFactor(double Re) Calculate Darcy friction factor using Colebrook-White equation.private doublecalculateGrayPressureDrop(SystemInterface fluid, double segmentLength) Gray (1974) pressure drop - optimized for gas wells with condensate.private doublecalculateHagedornBrownPressureDrop(SystemInterface fluid, double segmentLength) Hagedorn and Brown (1965) pressure drop - optimized for vertical oil wells.private doublecalculateHasanKabirPressureDrop(SystemInterface fluid, double segmentLength) Hasan and Kabir (2002) mechanistic model.private doublecalculateIPRPressure(WellFlow iprModel, double flowRate, double reservoirPressure) Calculate IPR pressure for a given flow rate using the WellFlow model.private doublecalculateRameyTemperature(double depth, double bhTemp) Calculate temperature using Ramey (1962) steady-state model.private doublecalculateSegmentPressureDrop(SystemInterface fluid, double segmentLength) Calculate pressure drop for a single segment using the selected correlation.private doublecalculateTemperatureAtDepth(double depth, double bhTemp) Calculate temperature at a given depth using the selected temperature model.private doubleconvertFlowRate(double value, String fromUnit, String toUnit) private doubleconvertPressure(double value, String fromUnit, String toUnit) private doubleconvertTemperatureToKelvin(double temp, String unit) voidDisable table-based VLP and use correlation-based calculations.double[]findOperatingPoint(WellFlow iprModel, double wellheadPressure, String pressureUnit) Find the operating point (intersection of IPR and VLP).double[][]generateVLPCurve(double[] flowRates, String flowUnit, String pressureUnit) Generate a VLP curve (Tubing Performance Curve).double[][]generateVLPCurve(double[] flowRates, String flowUnit, String pressureUnit, double targetWHP) Generate a VLP curve for a specified wellhead pressure.List<double[][]> generateVLPFamily(double[] flowRates, String flowUnit, double[] whPressures, String pressureUnit) Generate VLP curves for multiple wellhead pressures.doublegetBottomHolePressure(String unit) Get calculated bottom-hole pressure.double[]Get depth profile (from surface).double[]Get liquid holdup profile.double[]Get pressure profile along tubing.double[]Get temperature profile along tubing.doublegetTotalPressureDrop(String unit) Get total pressure drop through tubing.double[][]Get the most recent VLP curve data.double[]Get the current VLP table BHP values.double[]Get the current VLP table flow rates.doubleGet the wellhead pressure for the VLP table.doublegetWellheadPressure(String unit) Get calculated wellhead pressure.doubleinterpolateBHPFromTable(double flowRate) Get BHP from table VLP by interpolation.booleanCheck if using table-based VLP.voidloadVLPFromFile(String filePath, double wellheadPressure) Load VLP curve from a CSV file.voidloadVLPFromFile(Path filePath, double wellheadPressure) Load VLP curve from a CSV file.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidsetBottomHoleTemperature(double temperature, String unit) Set bottom-hole temperature (reservoir temperature).voidsetGeothermalGradient(double gradient, String unit) Set geothermal gradient for Ramey model.voidsetInclination(double angleDegrees) Set well inclination from horizontal.voidsetNumberOfSegments(int segments) Set number of calculation segments.voidsetOverallHeatTransferCoefficient(double coefficient) Set overall heat transfer coefficient for wellbore.voidSet the pressure-drop correlation to use.voidsetProductionTime(double time, String unit) Set production time for transient Ramey model.voidsetTableVLP(double[] flowRates, double[] bottomHolePressures, double wellheadPressure) Set VLP table data for table-based pressure drop calculation.voidSet the temperature model to use.voidsetTubingDiameter(double diameter, String unit) Set tubing inner diameter.voidsetTubingLength(double length, String unit) Set tubing measured depth (along wellbore).voidsetWallRoughness(double roughness, String unit) Set pipe wall roughness.voidsetWellheadTemperature(double temperature, String unit) Set wellhead temperature.private voidMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, toJson, toJson, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, displayResult, equals, getConditionAnalysisMessage, getController, getEnergyStream, getEntropyProduction, getExergyChange, getMassBalance, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, initMechanicalDesign, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getExergyChange, getFluid, getRestCapacity, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from interface TwoPortInterface
getInStream, getOutStream
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger object for class. -
tubingLength
private double tubingLength -
tubingDiameter
private double tubingDiameter -
wallRoughness
private double wallRoughness -
inclination
private double inclination -
numberOfSegments
private int numberOfSegments -
pressureDropCorrelation
-
temperatureModel
-
bottomHoleTemperature
private double bottomHoleTemperature -
wellheadTemperature
private double wellheadTemperature -
geothermalGradient
private double geothermalGradient -
overallHeatTransferCoeff
private double overallHeatTransferCoeff -
formationThermalConductivity
private double formationThermalConductivity -
productionTime
private double productionTime -
bottomHolePressure
private double bottomHolePressure -
wellheadPressure
private double wellheadPressure -
pressureProfile
private double[] pressureProfile -
temperatureProfile
private double[] temperatureProfile -
depthProfile
private double[] depthProfile -
holdupProfile
private double[] holdupProfile -
totalPressureDrop
private double totalPressureDrop -
vlpFlowRates
private double[] vlpFlowRates -
vlpBottomHolePressures
private double[] vlpBottomHolePressures -
vlpWellheadPressures
private double[] vlpWellheadPressures -
useTableVLP
private boolean useTableVLP -
tableVLPFlowRates
private double[] tableVLPFlowRates -
tableVLPBHP
private double[] tableVLPBHP -
tableVLPWellheadPressure
private double tableVLPWellheadPressure
-
-
Constructor Details
-
TubingPerformance
Constructor for TubingPerformance.- Parameters:
name- equipment name
-
TubingPerformance
Constructor for TubingPerformance with inlet stream.- Parameters:
name- equipment nameinletStream- inlet stream (typically from reservoir or WellFlow)
-
-
Method Details
-
setTubingLength
Set tubing measured depth (along wellbore).- Parameters:
length- tubing lengthunit- length unit ("m", "ft")
-
setTubingDiameter
Set tubing inner diameter.- Parameters:
diameter- inner diameterunit- diameter unit ("m", "in", "mm")
-
setWallRoughness
Set pipe wall roughness.- Parameters:
roughness- wall roughnessunit- roughness unit ("m", "mm", "in")
-
setInclination
public void setInclination(double angleDegrees) Set well inclination from horizontal.- Parameters:
angleDegrees- inclination angle (90 = vertical, 0 = horizontal)
-
setNumberOfSegments
public void setNumberOfSegments(int segments) Set number of calculation segments.- Parameters:
segments- number of segments for pressure integration
-
setPressureDropCorrelation
Set the pressure-drop correlation to use.- Parameters:
correlation- pressure-drop correlation
-
setTemperatureModel
Set the temperature model to use.- Parameters:
model- temperature model
-
setBottomHoleTemperature
Set bottom-hole temperature (reservoir temperature).- Parameters:
temperature- bottom-hole temperatureunit- temperature unit ("K", "C", "F")
-
setWellheadTemperature
Set wellhead temperature.- Parameters:
temperature- wellhead temperatureunit- temperature unit ("K", "C", "F")
-
setGeothermalGradient
Set geothermal gradient for Ramey model.- Parameters:
gradient- temperature gradientunit- gradient unit ("K/m", "C/100m", "F/100ft")
-
setOverallHeatTransferCoefficient
public void setOverallHeatTransferCoefficient(double coefficient) Set overall heat transfer coefficient for wellbore.- Parameters:
coefficient- heat transfer coefficient in W/(m²·K)
-
setProductionTime
Set production time for transient Ramey model.- Parameters:
time- production timeunit- time unit ("s", "hr", "day")
-
convertTemperatureToKelvin
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
Calculates wellhead conditions from bottom-hole conditions by integrating the pressure-drop correlation up the tubing.
- Parameters:
id- UUID
-
calculateTemperatureAtDepth
private double calculateTemperatureAtDepth(double depth, double bhTemp) Calculate temperature at a given depth using the selected temperature model.- Parameters:
depth- current depth (m from surface, 0 = surface)bhTemp- bottom-hole temperature (K)- Returns:
- temperature at depth (K)
-
calculateRameyTemperature
private double calculateRameyTemperature(double depth, double bhTemp) Calculate temperature using Ramey (1962) steady-state model.The Ramey model accounts for:
- Geothermal gradient of the formation
- Heat transfer between wellbore and formation
- Time-dependent behavior (transient heat conduction)
- Parameters:
depth- depth from surface (m)bhTemp- bottom-hole temperature (K)- Returns:
- temperature at depth (K)
-
calculateSegmentPressureDrop
Calculate pressure drop for a single segment using the selected correlation.- Parameters:
fluid- fluid at segment conditionssegmentLength- length of segment (m)- Returns:
- pressure drop (bar)
-
calculateBeggsBrillPressureDrop
Beggs and Brill (1973) pressure drop calculation.- Parameters:
fluid- the fluid systemsegmentLength- the segment length in meters- Returns:
- pressure drop in bar
-
calculateHagedornBrownPressureDrop
Hagedorn and Brown (1965) pressure drop - optimized for vertical oil wells.- Parameters:
fluid- the fluid systemsegmentLength- the segment length in meters- Returns:
- pressure drop in bar
-
calculateGrayPressureDrop
Gray (1974) pressure drop - optimized for gas wells with condensate.- Parameters:
fluid- the fluid systemsegmentLength- the segment length in meters- Returns:
- pressure drop in bar
-
calculateHasanKabirPressureDrop
Hasan and Kabir (2002) mechanistic model.- Parameters:
fluid- the fluid systemsegmentLength- the segment length in meters- Returns:
- pressure drop in bar
-
calculateDunsRosPressureDrop
Duns and Ros (1963) pressure drop - for gas wells.- Parameters:
fluid- the fluid systemsegmentLength- the segment length in meters- Returns:
- pressure drop in bar
-
calculateFrictionFactor
private double calculateFrictionFactor(double Re) Calculate Darcy friction factor using Colebrook-White equation.- Parameters:
Re- Reynolds number- Returns:
- Darcy friction factor
-
generateVLPCurve
Generate a VLP curve (Tubing Performance Curve).Calculates the required bottom-hole pressure for each flow rate to achieve a specified wellhead pressure. This is essential for nodal analysis and reservoir simulation coupling.
- Parameters:
flowRates- array of flow rates to evaluateflowUnit- flow rate unit ("Sm3/day", "bbl/day", "kg/sec", etc.)pressureUnit- pressure unit for output ("bara", "psia", etc.)- Returns:
- 2D array: [0]=flow rates, [1]=bottom-hole pressures, [2]=wellhead pressures
-
generateVLPCurve
public double[][] generateVLPCurve(double[] flowRates, String flowUnit, String pressureUnit, double targetWHP) Generate a VLP curve for a specified wellhead pressure.- Parameters:
flowRates- array of flow rates to evaluateflowUnit- flow rate unitpressureUnit- pressure unit for outputtargetWHP- target wellhead pressure (bara)- Returns:
- 2D array: [0]=flow rates, [1]=bottom-hole pressures, [2]=wellhead pressures
-
generateVLPFamily
public List<double[][]> generateVLPFamily(double[] flowRates, String flowUnit, double[] whPressures, String pressureUnit) Generate VLP curves for multiple wellhead pressures.This produces a family of VLP curves useful for sensitivity analysis and reservoir simulator table generation.
- Parameters:
flowRates- array of flow ratesflowUnit- flow rate unitwhPressures- array of wellhead pressurespressureUnit- pressure unit- Returns:
- List of VLP curves, one per WHP
-
findOperatingPoint
Find the operating point (intersection of IPR and VLP).Given a WellFlow (IPR model) and target wellhead pressure, finds the flow rate and bottom-hole pressure where IPR = VLP.
- Parameters:
iprModel- WellFlow object representing the IPRwellheadPressure- target wellhead pressurepressureUnit- pressure unit- Returns:
- double[2]: [0]=operating flow rate (Sm3/day), [1]=BHP (bara)
-
calculateIPRPressure
Calculate IPR pressure for a given flow rate using the WellFlow model.- Parameters:
iprModel- the WellFlow IPR modelflowRate- the flow ratereservoirPressure- the reservoir pressure in bar- Returns:
- the calculated bottom-hole pressure in bar
-
convertFlowRate
-
convertPressure
-
getBottomHolePressure
Get calculated bottom-hole pressure.- Parameters:
unit- pressure unit- Returns:
- bottom-hole pressure
-
getWellheadPressure
Get calculated wellhead pressure.- Parameters:
unit- pressure unit- Returns:
- wellhead pressure
-
getTotalPressureDrop
Get total pressure drop through tubing.- Parameters:
unit- pressure unit- Returns:
- total pressure drop
-
getPressureProfile
public double[] getPressureProfile()Get pressure profile along tubing.- Returns:
- pressure profile array (bara)
-
getTemperatureProfile
public double[] getTemperatureProfile()Get temperature profile along tubing.- Returns:
- temperature profile array (K)
-
getDepthProfile
public double[] getDepthProfile()Get depth profile (from surface).- Returns:
- depth profile array (m)
-
getHoldupProfile
public double[] getHoldupProfile()Get liquid holdup profile.- Returns:
- holdup profile array (fraction)
-
getVLPCurve
public double[][] getVLPCurve()Get the most recent VLP curve data.- Returns:
- VLP curve: [0]=flow rates, [1]=BHP, [2]=WHP
-
setTableVLP
public void setTableVLP(double[] flowRates, double[] bottomHolePressures, double wellheadPressure) Set VLP table data for table-based pressure drop calculation.When using table VLP, the pressure drop is interpolated from the provided curve instead of being calculated from correlations. This is useful when you have measured or pre-calculated VLP data.
- Parameters:
flowRates- flow rates (same unit as stream flow rate)bottomHolePressures- corresponding bottom-hole pressures (bara)wellheadPressure- wellhead pressure that the curve was generated for (bara)
-
loadVLPFromFile
Load VLP curve from a CSV file.The CSV file should have two columns: flow rate and bottom-hole pressure. The wellhead pressure must be specified separately. The first row can be a header (will be skipped if non-numeric).
Example CSV format:
FlowRate(MSm3/day),BHP(bara) 0.5,85 1.0,92 2.0,115 3.0,145 4.0,182 5.0,225
- Parameters:
filePath- path to the CSV filewellheadPressure- wellhead pressure the curve was generated for (bara)- Throws:
IOException- if file cannot be read
-
loadVLPFromFile
Load VLP curve from a CSV file.- Parameters:
filePath- path to the CSV filewellheadPressure- wellhead pressure the curve was generated for (bara)- Throws:
IOException- if file cannot be read- See Also:
-
isUsingTableVLP
public boolean isUsingTableVLP()Check if using table-based VLP.- Returns:
- true if using table VLP, false if using correlation-based
-
disableTableVLP
public void disableTableVLP()Disable table-based VLP and use correlation-based calculations. -
interpolateBHPFromTable
public double interpolateBHPFromTable(double flowRate) Get BHP from table VLP by interpolation.- Parameters:
flowRate- flow rate- Returns:
- interpolated bottom-hole pressure (bara)
-
getVLPTableFlowRates
public double[] getVLPTableFlowRates()Get the current VLP table flow rates.- Returns:
- array of flow rates, or empty array if not using table VLP
-
getVLPTableBHP
public double[] getVLPTableBHP()Get the current VLP table BHP values.- Returns:
- array of BHP values (bara), or empty array if not using table VLP
-
getVLPTableWellheadPressure
public double getVLPTableWellheadPressure()Get the wellhead pressure for the VLP table.- Returns:
- wellhead pressure (bara), or NaN if not using table VLP
-
sortVLPTableByFlowRate
private void sortVLPTableByFlowRate()
-