Valve calculations
Functions to generate valve performance curves and valve pressure tables using current conditions.
PressureDrop.SageAndLacy_nitrogen_Zfactor
PressureDrop.ThornhillCraver_gaspassage
PressureDrop.ThornhillCraver_gaspassage_simplified
PressureDrop.domepressure_downhole
PressureDrop.estimate_valve_Rvalue
PressureDrop.valve_calcs
PressureDrop.valve_table
Example
using PressureDrop
MDs = [0,1813, 2375, 2885, 3395]
TVDs = [0,1800, 2350, 2850, 3350]
incs = [0,0,0,0,0]
id = 2.441
well = Wellbore(MDs, incs, TVDs, id)
valves = GasliftValves([1813,2375,2885,3395], #valve MDs
[1005,990,975,960], #valve PTROs (psig)
[0.073,0.073,0.073,0.073], #valve R-values
[16,16,16,16]) #valve port sizes in 64ths inches
tubing_pressures = [150,837,850,840,831] #pressures at depth
casing_pressures = 1070 .+ [0,53,70,85,100]
temps = [135,145,148,151,153] #temps at depth
vdata, inj_depth = valve_calcs(valves = valves, well = well, sg_gas = 0.72, tubing_pressures = tubing_pressures, casing_pressures = casing_pressures, tubing_temps = temps, casing_temps = temps)
valve_table(vdata, inj_depth)
╭─────┬──────┬──────┬──────┬──────┬───────┬───────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬───────┬───────┬───────╮
│ GLV │ MD │ TVD │ PSO │ PSC │ Port │ R │ PPEF │ PTRO │ TP │ CP │ PVO │ PVC │ T_td │ T_cd │ Q_o │ Q_1.5 │ Q_1 │
│ │ ft │ ft │ psig │ psig │ 64ths │ │ % │ psig │ psig │ psig │ psig │ psig │ °F │ °F │ mcf/d │ mcf/d │ mcf/d │
├─────┼──────┼──────┼──────┼──────┼───────┼───────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼───────┼───────┼───────┤
│ 4 │ 1813 │ 1800 │ 1077 │ 1056 │ 16 │ 0.073 │ 8 │ 1005 │ 837 │ 1123 │ 1130 │ 1109 │ 145 │ 145 │ 1261 │ 959 │ 757 │
│ 3 │ 2375 │ 2350 │ 1048 │ 1028 │ 16 │ 0.073 │ 8 │ 990 │ 850 │ 1140 │ 1118 │ 1098 │ 148 │ 148 │ 1276 │ 970 │ 766 │
│ 2 │ 2885 │ 2850 │ 1022 │ 1002 │ 16 │ 0.073 │ 8 │ 975 │ 840 │ 1155 │ 1107 │ 1087 │ 151 │ 151 │ 1315 │ 999 │ 789 │
│ 1 │ 3395 │ 3350 │ 993 │ 974 │ 16 │ 0.073 │ 8 │ 960 │ 831 │ 1170 │ 1093 │ 1074 │ 153 │ 153 │ 1351 │ 1027 │ 811 │
╰─────┴──────┴──────┴──────┴──────┴───────┴───────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴───────┴───────┴───────╯
Functions
PressureDrop.estimate_valve_Rvalue
— Function.estimate_valve_Rvalue(port_size, valve_size, lapped_seat = true)
Estimates an R-value for your valve (not recommended) using sensible defaults, if you do not have a manufacturer-provided value specific to the valve (recommended).
Takes port size as a diameter in 64ths inches, a valve size in inches {1.0, 1.5}, and an indication of whether the seat is lapped as {true, false}.
PressureDrop.valve_calcs
— Method.valve_calcs(<named args>)
Calculates a standard table of pressures and temperatures for anticipated valve operation at current (steady-state) conditions.
Note that all inputs and outputs are in psig for ease of interpretation.
Additionally, all forms are derived from the force balance for opening, Pt * Ap + Pc * (Ad - Ap) ≥ Pd * Ad and the force balance for closing, Pc ≤ P_d.
Further note that:
- the valve closing pressures given are a theoretical minimum (casing pressure is assumed to act on the entire area of the bellows/dome until closing).
- valve opening and closing pressures are recalculated from PTRO and current conditions, rather than the other way around common during design.
- casing temperature is assumed to be 85% of tubing temperature if only a tubing temperature profile is provided. To force the use of identical temperature profiles, pass the wellbore temperature twice.
Arguments
valves::GasliftValves
: a GasliftValves object defining the valve stringwell::Wellbore
: a Wellbore object defining the survey/segmentation points, deviation survey, and tubingsg_gas
: injection gas specific gravitytubing_pressures::Array{T, 1} where T <: Real
: precalculated tubing pressures in psigcasing_pressures::Array{T, 1} where T <: Real
: precalculated casing pressures in psigtubing_temps::Array{T, 1} where T <: Real
: precalculated tubing temperature profile in °Fcasing_temps::Array{T, 1} where T <: Real = tubing_temps .* 0.85
: precalculated casing temperature profile in °Fdp_min = 100
: minimum differential pressure (CP - TP) in psi for calculating an assumed injection pointone_inch_coefficient = 0.76
: coefficient of discharge for Thornhill-Craver gas passage calculations for 1" valvesone_pt_five_inch_coefficient = 0.6
: coefficient of discharge for Thornhill-Craver gas passage calculations for 1.5" valves
PressureDrop.valve_table
— Function.valve_table(valvedata, injection_depth = nothing)
Pretty prints the data returned by valve_calcs
for interpretation.
SageAndLacy_nitrogen_Zfactor(p, T)
Sage and Lacy experimental Z-factor correlation.
Takes pressure in psia and temperature in °F.
PressureDrop.ThornhillCraver_gaspassage
— Function.ThornhillCraver_gaspassage(<args>)
Thornhill-Craver gas throughput for square-edged orifice.
See section 8.1 of Fundamentals of Gas Lift Engineering by Ali Hernandez, as well as published work by Ken Decker, for an in-depth discussion of the application of Thornhill-Craver to gas lift valve performance.
In general, T-C will be optimistic, but should be expected to have an effective error of up to +/- 30%.
Arguments
P_td
: tubing pressure at depth, psigP_cd
: casing pressure at depth, psigT_cd
: gas (casing fluid) temperature at depth, °Fportsize_64ths
: valve port size in 64ths inchsg_gas
: gas specific gravity relative to airmolFracCO2 = 0.0
,molFracH2S = 0.0
: produced gas fractions of hydrogen sulfide and CO2, [0,1]C_d = 0.827
: discharge coefficient–uses 0.827 by defaul to match original T-CZ_correlation::Function = KareemEtAlZFactor
: natural gas compressibility/Z-factor correlation to usepseudocrit_pressure_correlation::Function = HankinsonWithWichertPseudoCriticalPressure
: psuedocritical pressure function to usepseudocrit_temp_correlation::Function = HankinsonWithWichertPseudoCriticalTemp
: pseudocritical temperature function to use
ThornhillCraver_gaspassage_simplified(P_td, P_cd, T_cd, portsize_64ths)
Thornhill-Craver gas throughput for square-edged orifice (optimistic since it assumes a fully open valve where the stem does not interfere with flow).
This simplified version assumes gas specific gravity at 0.65.
Arguments
P_td
: tubing pressure at depth, psigP_cd
: casing pressure at depth, psigT_cd
: gas (casing fluid) temperature at depth, °Fportsize_64ths
: valve port size in 64ths inch
PressureDrop.domepressure_downhole
— Function.domepressure_downhole(p_d_set, T_v, error_tolerance = 0.1, p_d_est = p_d_set/0.9, T_set = 60, Zfactor::Function = SageAndLacy_nitrogen_Zfactor)
Iteratively calculates the dome pressure in psia of the valve downhole using gas equation of state, assuming that the change in dome volume is negligible.
Arguments
PTRO
: test rack opening pressure of valve in psigR
: R-value of the valve (nominally, area of port divided by area of bellows/dome, but adjusted for lapped seats, etc)T_v
: valve temperature at deptherror_tolerance = 0.1
: error tolerance in psidelta_est
: initial estimate for downhole dome pressure as a percentage of surface set pressureT_set = 60
: setting temperature in °FZfactor::Function = SageAndLacy_nitrogen_Zfactor
: Z-factor function parameterized by target conditions as pressure in psia and temperature in °F