Utilities

Utilities

Note

The functions to read files all expect CSVs with headers, defined in field units.

Functions

read_survey(<named arguments>)

Reads in a wellbore deviation survey from a delimited file and returns a Wellbore object for use with pressure drop calculations.

Assumes the column order for the file is (MD, INC, TVD, <optional ID>), in U.S. field units, where: MD = measured depth, ft Inc = inclination, degrees from vertical TVD = true vertical depth, ft ID = pipe hydraulic diameter, inches

Arguments

  • path::String: absolute or relative path to survey file
  • delim::Char = ',': file delimiter
  • skiplines::Int64 = 1: number of lines to skip before survey data starts; assumes a 1-line header by default
  • maxdepth::Union{Bool, Real} = false: If set to a real number, drop survey data past a certain measured depth. If false, keep the entire survey.
  • id_included::Bool = false: whether the survey segment ID is stored as a fourth column. This is the easiest option to include tapered strings.
  • id::Real = 2.441: the diameter to assume for the entire wellbore length, if the ID is not included in the survey file.
  • valves::Union{GasliftValves, Nothing} = nothing: set of gas lift valves to add corresponding depths to the final Wellbore object via interpolation
  • allow_negatives::Bool = false: allow negative depths on the survey inputs
source

read_valves(;path::String, delim::Char = ',', skiplines::Int64 = 1)

Expects a CSV with columns for [measured depth (ft)], [test rack opening pressure (psig)], [R-value (dimensionless)], [port size (diameter in 64ths inch)].

Indicate orifice valves with an R-value and PTRO of 0.

Arguments

  • path::String: absolute or relative path to survey file
  • delim::Char = ',': file delimiter
  • skiplines::Int64 = 1: number of lines to skip before survey data starts; assumes a 1-line header by default
source

interpolate(ref_array, property::Array{Real,1}, point)

Interpolate between points without any bounds checking.

source

interpolate_all(well::Wellbore, properties::Array{Array{Real,1},1}, points::Array{Real,1})

Interpolate multiple points for multiple properties with bounds checking.

source