TheTechIdea.OilGas.Production
18 public types. Summaries come from the XML documentation of the compiled assembly.
TheTechIdea.OilGas.Production
| Type | Summary |
|---|---|
BuildupInputsclass | Reservoir, fluid and well inputs of a build-up test (field units: md, cp, bbl/STB, 1/psi, ft, STB/D, STB). |
BuildupReadingstruct | One shut-in pressure reading of a build-up test. |
BuildupResultclass | Result of a Horner build-up analysis (field units). |
DeclineCurveclass | An Arps (1945) decline: qi, Di (per time unit) and b (0 exponential, (0,1) hyperbolic, 1 harmonic). |
DeclineFitclass | Result of fitting a decline curve to rate-time data. |
DeclineFitterstatic class | Fits an Arps (1945) decline curve to rate-time data. b = 0 (exponential) and b = 1 (harmonic) are linear in ln(q) (exact least squares); 0 < b < 1 is found by a golden-section search on b, each evaluation an exact exponential-style fit of qi and Di to the b-transformed rate (q^-b is linear in t for a hyperbolic decline), minimising the sum of squared ln(q) residuals. |
FlowPropertiesclass | Fluid properties at a point of the string (field units: lbm/ft3, cP, lbf/ft, scf/STB, bbl/scf, fraction). |
FluidDefaultsclass | Typical fluid properties of a field, used for what a flow calculation was not given (toolboxes.production.defaultFluid). Unset values stay unset: a missing one is an error, never a guess. |
HornerAnalysisstatic class | Horner (1951) build-up analysis: pws = p* - m log10((tp + dt)/dt); m = 162.6 q B mu / (k h); skin s = 1.151 [(p1hr - pwf) / m - log10(k / (phi mu ct rw^2)) + 3.23] (field units, as derived in standard well-testing references - e.g. Lee, "Well Testing"; Ahmed, "Reservoir Engineering Handbook"). p1hr and the slope come from the straight line fitted to the (log Horner ratio, pws) points supplied (the caller selects the middle-time straight-line region; this does not pick it automatically). |
NodalAnalysisstatic class | Nodal analysis at the bottomhole: an inflow (IPR) curve against the tubing outflow (Beggs-Brill) curve. |
NodalResultclass | Result of a nodal analysis (operating point of inflow vs outflow at the bottomhole). |
ProductionSettingsclass | Settings of the production and reservoir toolbox (environment section toolboxes.production). |
ProductionToolboxstatic class | Production and reservoir toolbox: decline curve analysis, inflow performance and nodal analysis, pressure-test interpretation. |
RateObservationstruct | A rate observation. |
ReservoirDefaultsclass | Typical reservoir and fluid properties of a field, used for what a build-up analysis was not given (toolboxes.production.defaultReservoir). Unset values stay unset: a missing one is an error. |
TraversePointclass | One point of a pressure traverse. |
VerticalLiftstatic class | Two-phase vertical (and inclined) flow pressure traverse: Beggs and Brill (1973), "A Study of Two-Phase Flow in Inclined Pipes" (SPE 4007). Flow-pattern boundaries, horizontal holdup and the two-phase friction factor are as published and checked against several independent reproductions, and so are the uphill inclination-correction coefficients (seven sources agree); the liquid velocity number it needs is computed from its dimensionless definition, so there is no constant to trust. |
Vogelstatic class | Inflow performance (IPR) of a solution-gas-drive well: Vogel (1968) below the bubble point, qo = qomax [1 - 0.2(pwf/pr) - 0.8(pwf/pr)^2], a straight line (constant productivity index) above it. A fully saturated reservoir (bubblePointPressure >= reservoirPressure) uses Vogel over the whole range. |
BuildupInputs class
Reservoir, fluid and well inputs of a build-up test (field units: md, cp, bbl/STB, 1/psi, ft, STB/D, STB).
| Member | Summary |
|---|---|
double OilFvf { get; set; } | Oil formation volume factor (bbl/STB). |
double Porosity { get; set; } | Porosity (fraction). |
double ProducingTimeHours { get; set; } | Producing time before shut-in (hours); from cumulative production and rate (24 Np / q) when not stated directly. |
double PwfAtShutIn { get; set; } | Flowing bottomhole pressure immediately before shut-in (psia). |
double Rate { get; set; } | Last stable flow rate before shut-in (STB/D). |
double Thickness { get; set; } | Net pay thickness (ft). |
double TotalCompressibility { get; set; } | Total compressibility (1/psi). |
double Viscosity { get; set; } | Oil viscosity (cP). |
double WellboreRadius { get; set; } | Wellbore radius (ft). |
static double ProducingTimeFromCumulative(double cumulativeStb, double rateStbPerDay) | Producing time from cumulative production (STB) and the last rate: tp = 24 Np / q. |
BuildupInputs Resolved() | A complete copy: the rate, the flowing pressure before shut-in and the producing time are always required; the fluid and reservoir properties not set here come from toolboxes.production.defaultReservoir. A value set nowhere is an error, not a guess. |
BuildupReading struct
One shut-in pressure reading of a build-up test.
| Member | Summary |
|---|---|
BuildupReading(double deltaTHours, double pwsPsia) | Creates a reading. |
double DeltaT { get; } | Shut-in time (hours). |
double Pws { get; } | Shut-in (static) bottomhole pressure (psia). |
BuildupResult class
Result of a Horner build-up analysis (field units).
| Member | Summary |
|---|---|
double P1Hour { get; set; } | Extrapolated pressure at Delta t = 1 hour, from the fitted line. |
double Permeability { get; set; } | Permeability (md). |
List<(double, double, double)> Points { get; } | Points used in the fit (deltaT, Horner ratio, pws). |
double PStar { get; set; } | Extrapolated (Horner ratio = 1) pressure - the initial / average pressure estimate. |
double RSquared { get; set; } | Coefficient of determination of the fitted line over the points used. |
double Skin { get; set; } | Skin factor. |
double SkinPressureDrop { get; set; } | Additional pressure drop across the skin (psi) = 0.87 m s. |
double Slope { get; set; } | Semilog slope m (psi per log cycle; reported positive - pressure falls as the Horner ratio falls, so the fit slope is negative). |
DeclineCurve class
An Arps (1945) decline: qi, Di (per time unit) and b (0 exponential, (0,1) hyperbolic, 1 harmonic).
| Member | Summary |
|---|---|
double B { get; set; } | Arps exponent b. |
double Di { get; set; } | Initial (nominal) decline rate, per unit time. |
double Qi { get; set; } | Initial rate. |
string TimeUnit { get; set; } | Time unit the rates and Di are in (days, months ...) - for display only. |
double Cumulative(double t) | Cumulative production from 0 to t (closed form, each regime's own). |
double Eur(double economicLimit) | Estimated ultimate recovery to an economic limit rate (the closed form; same as Cumulative(TimeAtRate(limit))). |
List<(double, double, double)> Forecast(double economicLimit, double step, double t0 = 0, double? maxTime = null) | A forecast series from t0 to the economic limit (or maxTime), at step. |
double Rate(double t) | Rate at time t (Arps 1945). |
double TimeAtRate(double q) | Time at which the rate reaches q (q <= qi); Di = 0 (no decline) has no finite time unless q = qi. |
DeclineFit class
Result of fitting a decline curve to rate-time data.
| Member | Summary |
|---|---|
DeclineCurve Curve { get; set; } | The fitted curve. |
double RSquared { get; set; } | Coefficient of determination of ln(rate) over the data used to fit (0 fixed-b fits do not refit b). |
bool TransientFlowWarning { get; set; } | b exceeds production.maxPhysicalB: Arps overestimates reserves in transient flow (Arps 1945). |
DeclineFitter static class
Fits an Arps (1945) decline curve to rate-time data. b = 0 (exponential) and b = 1 (harmonic) are linear in ln(q) (exact least squares); 0 < b < 1 is found by a golden-section search on b, each evaluation an exact exponential-style fit of qi and Di to the b-transformed rate (q^-b is linear in t for a hyperbolic decline), minimising the sum of squared ln(q) residuals.
| Member | Summary |
|---|---|
static DeclineFit Fit(IReadOnlyList<RateObservation> data, double minB = 0, double? maxBOrNull = null) | Fits qi, Di and b by minimising the sum of squared ln(rate) residuals over the data. The search runs from minB (0 is the exponential) up to maxB (none: production.declineSearchMaxB). |
static DeclineFit FitFixedB(IReadOnlyList<RateObservation> data, double b) | Fits with b fixed (0 exponential, 1 harmonic, else hyperbolic at that b) - qi, Di by exact linear least squares. |
static string ToCsv(IEnumerable<(double, double, double)> forecast, string timeUnit) | The forecast of a fit as CSV. |
FlowProperties class
Fluid properties at a point of the string (field units: lbm/ft3, cP, lbf/ft, scf/STB, bbl/scf, fraction).
| Member | Summary |
|---|---|
double GasDensity { get; set; } | Gas density at flowing conditions. |
double GasFvf { get; set; } | Gas formation volume factor (bbl/scf) at this pressure. |
double GasViscosity { get; set; } | Gas viscosity (cP). |
double LiquidDensity { get; set; } | Liquid (oil + water) density. |
double LiquidViscosity { get; set; } | Liquid viscosity (cP). |
double OilFvf { get; set; } | Oil formation volume factor (bbl/STB) at this pressure. |
double SolutionGor { get; set; } | Gas in solution at this pressure (scf/STB, Rs); free gas = produced GOR - Rs (>= 0). |
double SurfaceTension { get; set; } | Liquid surface tension (lbf/ft; 1 dyne/cm = 6.852e-5 lbf/ft). |
FlowProperties Resolved() | A complete copy: every value not set here comes from toolboxes.production.defaultFluid; the densities are always required. A value that is set nowhere is an error - a silent default would give a plausible answer for a fluid nobody described. |
FluidDefaults class
Typical fluid properties of a field, used for what a flow calculation was not given (toolboxes.production.defaultFluid). Unset values stay unset: a missing one is an error, never a guess.
| Member | Summary |
|---|---|
double? GasFvf { get; set; } | Gas formation volume factor (bbl/scf). |
double? GasViscosity { get; set; } | Gas viscosity (cP). |
double? LiquidViscosity { get; set; } | Liquid viscosity (cP). |
double? OilFvf { get; set; } | Oil formation volume factor (bbl/STB). |
double? SurfaceTension { get; set; } | Liquid surface tension (lbf/ft; 1 dyne/cm = 6.852e-5 lbf/ft). |
HornerAnalysis static class
Horner (1951) build-up analysis: pws = p* - m log10((tp + dt)/dt); m = 162.6 q B mu / (k h); skin s = 1.151 [(p1hr - pwf) / m - log10(k / (phi mu ct rw^2)) + 3.23] (field units, as derived in standard well-testing references - e.g. Lee, "Well Testing"; Ahmed, "Reservoir Engineering Handbook"). p1hr and the slope come from the straight line fitted to the (log Horner ratio, pws) points supplied (the caller selects the middle-time straight-line region; this does not pick it automatically).
| Member | Summary |
|---|---|
static BuildupResult Analyze(BuildupInputs inputs, IEnumerable<BuildupReading> readings) | Fits the Horner straight line to the given readings and computes permeability, skin and p*. |
static double HornerRatio(double producingTimeHours, double deltaTHours) | The Horner time ratio (tp + dt) / dt. |
static string ToCsv(BuildupResult r) | The points as CSV (invariant numbers). |
NodalAnalysis static class
Nodal analysis at the bottomhole: an inflow (IPR) curve against the tubing outflow (Beggs-Brill) curve.
| Member | Summary |
|---|---|
static NodalResult Solve(Func<double, double> inflowAtPwf, double maxRate, Func<double, double> outflowPwf, int? stepsOrNull = null) | Finds the operating point for a saturated reservoir's Vogel IPR by scanning rates and bisecting the sign change of (inflow pwf - outflow pwf). |
static NodalResult Solve(double maxRate, double reservoirPressure, double bubblePointPressure, Func<double, double> outflowPwf, int? steps = null) | Finds the operating point for a saturated reservoir's Vogel IPR by scanning rates and bisecting the sign change of (inflow pwf - outflow pwf). |
NodalResult class
Result of a nodal analysis (operating point of inflow vs outflow at the bottomhole).
| Member | Summary |
|---|---|
List<(double, double)> Inflow { get; } | Inflow (IPR) rate, bottomhole pressure pairs used. |
List<(double, double)> Outflow { get; } | Outflow (tubing intake) rate, bottomhole pressure pairs used. |
double? Pressure { get; set; } | Operating bottomhole pressure (psia). |
double? Rate { get; set; } | Operating liquid rate (STB/D); null when the curves do not cross in the searched range. |
ProductionSettings class
Settings of the production and reservoir toolbox (environment section toolboxes.production).
| Member | Summary |
|---|---|
double DeclineSearchMaxB { get; set; } | The largest decline exponent b the curve fit will try (the physical limit, productionMaxPhysicalB, only decides the warning). |
FluidDefaults DefaultFluid { get; set; } | Typical fluid properties, for what a flow calculation was not given. |
ReservoirDefaults DefaultReservoir { get; set; } | Typical reservoir properties, for what a build-up analysis was not given. |
bool InclinationCorrection { get; set; } | Apply the Beggs-Brill inclination correction to the liquid holdup of segregated and intermittent upward flow. It is part of the published method, so it is on by default; switch it off to see the horizontal holdup (for example to reproduce another tool's result). |
Measure LiftStep { get; set; } | Step length of the Beggs-Brill pressure traverse. |
double MaxPhysicalB { get; set; } | b above which a fitted hyperbolic decline is reported as transient flow rather than depletion (Arps overestimates reserves): 1.0 (Arps 1945; widely cited as the practical limit). |
int NodalScanSteps { get; set; } | How many rate steps the nodal analysis scans for a sign change between inflow and outflow; a finer scan can find operating points a coarse one steps over, at the cost of more traverses. |
Measure PipeRoughness { get; set; } | Absolute roughness of the tubing wall, for the friction factor (relative roughness = roughness / inside diameter). 0.0006 in is a figure often used for new steel tubing - an assumption: set the roughness of your tubing. |
ProductionToolbox static class
Production and reservoir toolbox: decline curve analysis, inflow performance and nodal analysis, pressure-test interpretation.
| Member | Summary |
|---|---|
static ProductionSettings Settings { get; } | The toolbox's settings in the current environment. |
const string Name = "production" | Section name in the environment's toolboxes. |
static void Register() | Registers the toolbox with the environment (idempotent); hosts call it at start-up, the toolbox's own entry points call it too. |
RateObservation struct
A rate observation.
| Member | Summary |
|---|---|
RateObservation(double t, double rate) | Creates an observation. |
double Rate { get; } | Rate. |
double T { get; } | Time (from the first observation, or as given). |
ReservoirDefaults class
Typical reservoir and fluid properties of a field, used for what a build-up analysis was not given (toolboxes.production.defaultReservoir). Unset values stay unset: a missing one is an error.
| Member | Summary |
|---|---|
double? OilFvf { get; set; } | Oil formation volume factor (bbl/STB). |
double? Porosity { get; set; } | Porosity (fraction). |
double? Thickness { get; set; } | Net pay thickness (ft). |
double? TotalCompressibility { get; set; } | Total compressibility (1/psi). |
double? Viscosity { get; set; } | Oil viscosity (cP). |
double? WellboreRadius { get; set; } | Wellbore radius (ft). |
TraversePoint class
One point of a pressure traverse.
| Member | Summary |
|---|---|
double LiquidHoldup { get; set; } | Liquid holdup. |
double Md { get; set; } | Measured depth (ft). |
double MixtureVelocity { get; set; } | Mixture velocity (ft/s). |
double NoSlipHoldup { get; set; } | No-slip liquid fraction. |
double Pressure { get; set; } | Pressure (psia). |
string Regime { get; set; } | Flow regime. |
VerticalLift static class
Two-phase vertical (and inclined) flow pressure traverse: Beggs and Brill (1973), "A Study of Two-Phase Flow in Inclined Pipes" (SPE 4007). Flow-pattern boundaries, horizontal holdup and the two-phase friction factor are as published and checked against several independent reproductions, and so are the uphill inclination-correction coefficients (seven sources agree); the liquid velocity number it needs is computed from its dimensionless definition, so there is no constant to trust.
| Member | Summary |
|---|---|
static double BottomholePressure(double bottomholeMd, double topMd, double outletPressure, double idIn, double liquidRateBpd, double gasRateMcfd, double gorScfStb, FlowProperties props, double inclinationDeg = 90) | Flowing bottomhole pressure for a given liquid rate (tubing-intake / outflow curve point). |
static (double, double, double, double) Boundaries(double lambdaL) | Flow pattern boundaries (L1-L4) at a no-slip liquid fraction. |
static double DarcyFrictionFactor(double reynolds, double relativeRoughness) | Darcy friction factor (Chen 1979 explicit correlation; smooth-pipe default). |
static (double, TraversePoint) Gradient(double pressure, double md, double idIn, double liquidRateBpd, double gasRateMcfd, double gorScfStb, FlowProperties props, double inclinationDeg) | Pressure gradient (psi/ft, positive = pressure increases downward) at a point along the string. |
static double Holdup(double lambdaL, double fr, double inclinationDeg, string regime) | Liquid holdup at inclination without the inclination correction (the horizontal holdup); see the overload that takes the liquid velocity number. |
static double Holdup(double lambdaL, double fr, double inclinationDeg, double liquidVelocityNumber, string regime) | Liquid holdup at inclination (degrees from horizontal, positive upward): the horizontal correlation (blended for transition flow), then HL(theta) = psi HL(0), psi = 1 + C [sin(1.8 theta) - 0.333 sin^3(1.8 theta)], C = (1 - lambdaL) ln(d lambdaL^e N_LV^f Fr^g) with C >= 0 (Beggs and Brill 1973; uphill coefficients: segregated 0.011, -3.768, 3.539, -1.614; intermittent 2.96, 0.305, -0.4473, 0.0978; distributed needs none). The correction is applied when production.inclinationCorrection is on (the default - it is part of the published method), the flow is upward and N_LV is given; downhill flow is not corrected (its coefficients could not be matched unambiguously). In the transition region psi is interpolated with the same weights as the horizontal holdups, which keeps the result continuous across the pattern boundaries. |
static double LiquidVelocityNumber(double superficialLiquidVelocity, double liquidDensity, double surfaceTension) | The Duns and Ros liquid velocity number N_LV = v_sL (rho_L / (g sigma))^(1/4) - dimensionless, so in SI units (m/s, kg/m3, N/m) there is no constant to look up; the 1.938 of the field-unit form (ft/s, lbm/ft3, dyne/cm) is only this expression after unit conversion. |
static string Pattern(double lambdaL, double fr) | The flow pattern ("Segregated", "Intermittent", "Distributed", "Transition") at lambdaL, Fr. |
static List<TraversePoint> Traverse(double bottomholeMd, double topMd, double outletPressure, double idIn, double liquidRateBpd, double gasRateMcfd, double gorScfStb, FlowProperties props, double inclinationDeg = 90) | Traverses from the bottom (bottomholeMd, outletPressure - the wellhead or separator pressure, flow going up) to the top (topMd), marching upward in steps of production.liftStep; fluid properties constant along the string (a simple constant-property model - a full PVT-dependent traverse can supply per-point properties by overriding step by step). Returns the pressure at each point, bottom to top. |
static double TwoPhaseFrictionFactor(double noSlipFrictionFactor, double lambdaL, double holdup) | Two-phase friction factor from the no-slip (Darcy) friction factor and the holdup (y = lambdaL / HL^2). |
Vogel static class
Inflow performance (IPR) of a solution-gas-drive well: Vogel (1968) below the bubble point, qo = qomax [1 - 0.2(pwf/pr) - 0.8(pwf/pr)^2], a straight line (constant productivity index) above it. A fully saturated reservoir (bubblePointPressure >= reservoirPressure) uses Vogel over the whole range.
| Member | Summary |
|---|---|
static double CompositeRate(double maxRate, double productivityIndexAboveBubble, double reservoirPressure, double bubblePointPressure, double pwf) | Rate at pwf for an undersaturated reservoir: the straight line q = j (pr - pwf) above the bubble point (the field-measured productivity index j - not derived from Vogel), Vogel's curve below it, matched in value (not slope) at pb. |
static double MaxRateFromProductivityIndex(double j, double reservoirPressure, double bubblePointPressure) | qomax (Vogel's curve below pb) matching a field productivity index j measured above the bubble point: qomax = j (pr - pb) / f(pb/pr). |
static double MaxRateFromTest(double testRate, double testPwf, double reservoirPressure) | qomax from one stabilised flow test point at or below the bubble point. |
static double Rate(double maxRate, double reservoirPressure, double bubblePointPressure, double pwf) | Rate at pwf for a fully saturated reservoir (bubblePointPressure >= reservoirPressure): pure Vogel over the whole range. |