Barrel Brain's script catalog
Every script runs on the server against Team76.Engineering, the engine the desktop app uses. Open one in the workbench to run it.
73 scripts
PVT
- Build a black-oil PVT table from a separator sample From oil gravity, gas gravity, temperature and the solution GOR, work out the bubble point, then Rs, Bo and viscosity from 500 to 5,000 psia.
- Compare the regional correlations on one oil Six saturation-pressure correlations and their matching Bo on one oil, side by side, with how far each sits from the mean: the spread you carry until a lab report picks one.
- Follow an undersaturated oil down to its saturation pressure An oil discovered 870 psi above its saturation pressure: its compressibility, how Bo and viscosity change on the way down, the oil in place at discovery, and how much the oil's own expansion recovers before it reaches that pressure.
- QC a black-oil table before it reaches the simulator Generate a Vasquez–Beggs black-oil table, run the Coats consistency inequalities over its saturated rows, then show the check catching one mistyped Rs.
- Screen a CO₂ injectant across its critical point Pure CO₂ at 122 °F from 500 to 5,000 psia: density and Z by the Span–Wagner reference equation, viscosity by Fenghour, and a mass-consistent Bg, through the jump from vapour-like to dense phase.
- Work out brine properties for a waterflood A 5 % NaCl brine at 200 °F from 1,000 to 5,000 psia: its formation volume factor, viscosity, compressibility and dissolved methane, by McCain's correlations, and the reservoir rate a surface injection rate becomes.
Equations of state
- Check the correlations against the equation of state A volatile oil from its composition: the Peng–Robinson phase envelope, critical point, cricondenbar and cricondentherm, the saturation pressure at reservoir temperature, and the vapour split off at 2,000 psia, with its Z from the equation of state against the Dranchuk–Abou-Kassem correlation on the same gravity.
- Pick the separator pressure that leaves the most stock-tank oil A two-stage separator test on a volatile oil: the first stage at 100 °F swept from 30 to 600 psia, the stock tank at 60 °F and 1 atm, with the GOR and Bo of each train and the first-stage pressure that maximises the stock-tank oil.
- Simulate a constant composition expansion on a volatile oil A 17-component volatile oil on Peng–Robinson: its saturation pressure at 220 °F, found without saying whether it is a bubble or a dew point, then the CCE from 6,000 to 1,000 psia with relative volume, liquid dropout and the Y-function.
Inflow performance
- Compare vertical, horizontal and fractured completions One 5 mD sand completed three ways: a vertical well as drilled and cleaned up, a 2,000 ft horizontal well by Joshi, and a fractured vertical well through the fracture's equivalent skin, at two fracture conductivities. Productivity index, the gain over the vertical well, and the fracture's dimensionless conductivity.
- Draw an undersaturated oil well's IPR curve The composite inflow curve of an undersaturated oil well, by generalized Vogel: straight above the bubble point, bending below it. Plotted against the straight-line PI drawn all the way down, with the absolute open flow of each and the shortfall at every flowing pressure.
- Fit Vogel and Fetkovich inflow curves to measured rates From a four-rate flow-after-flow test on a saturated oil reservoir: Vogel fitted to one test point, and Fetkovich's back-pressure curve fitted to all four by least squares, each with its absolute open flow, the test plotted over both.
- Work out a well's productivity index from Darcy's law The productivity index of a vertical oil well from permeability, net pay, viscosity, formation volume factor, drainage area and skin, in pseudosteady and steady state, and what the skin costs: J, flow efficiency and effective wellbore radius from an acidised well to a badly damaged one.
Well performance
- Find the well's operating point Hagedorn & Brown outflow against generalized Vogel inflow, intersected by the operating-point solver: the bottom-hole pressure where what the reservoir gives meets what the tubing can lift.
- Run a complete nodal analysis from the fluid to the operating point The whole PVT → IPR → VFP chain for one oil well: the bubble point, Bo and viscosity from black-oil correlations, a Darcy productivity index from them, a generalized Vogel inflow, a Hagedorn & Brown outflow at three wellhead pressures, and the operating point at each.
Decline curves
- Convert a decline rate between nominal and effective Turn a 15 %/yr nominal decline into its effective-annual, monthly and daily equivalents: the bookkeeping every forecast does before it starts.
- Find the bad months before fitting the decline Two years of monthly rates with a doubled allocation and a partial shut-in: flag the outliers, then fit the decline three ways (every point, IRLS with Huber weights, and without the flagged months) and compare the parameters and the EUR each one books.
- Find the economic limit and the reserves left The abandonment rate from the oil price, the lifting and fixed costs, the royalty and the tax; then the well's life, its ultimate recovery to that rate and the reserves still to come after three years, and how the recovery moves with the oil price.
- Forecast a well on an Arps hyperbolic decline Rate and cumulative by month from an initial rate, a nominal decline and a b-factor, to the month the well reaches its economic limit.
- Forecast the associated gas from the GOR trend Two years of oil rates and a rising GOR: fit the oil decline and a power-law GOR, and forecast the gas as the oil times the ratio for ten years, with and without a cap at the facilities' GOR.
- Pick the decline model, then book the EUR Fit five models to the same history, let AIC choose, and run the winner to the economic limit.
Well tests
- Find the oil a producing well contacts Four months of rate and flowing pressure from a well in a closed reservoir: material-balance time, then the flowing material balance line, whose slope gives the contacted oil in place and whose intercept gives the productivity index, without shutting the well in.
- Interpret a step-rate test by superposition A four-step rate test on the Odeh–Jones plot: rate-normalised pressure against the superposition time function puts every step on one straight line, whose slope gives permeability and whose intercept gives skin.
- Measure wellbore storage and when it ends The early hours of a drawdown on a log-log plot: the storage coefficient from the unit slope, the dimensionless storage, the time storage ends by the (60 + 3.5 s) CD rule, and permeability from the radial plateau that follows.
- Read a buildup A diagnostic plot that shows wellbore storage, radial flow and a sealing fault, then permeability from the Horner slope where the derivative is flat.
- Read a fracture half-length off a drawdown A drawdown on a hydraulically fractured well: the half slope of linear flow into the fracture, then the radial plateau. The plateau gives permeability, the √t slope then gives the fracture half-length, and the equivalent skin is the fracture as a wider well.
- Read permeability and skin off a drawdown A constant-rate drawdown on a semilog plot: the straight line after storage gives permeability from its slope and skin from its pressure at one hour, then the pressure the skin costs and the well's flow efficiency.
- Read √k·xf and the stimulated volume off a tight-oil well Two years of daily production from a fractured tight-oil well: Δp/q against √t gives √k xf, the end of linear flow gives the distance to the no-flow boundary and the stimulated reservoir volume, and the boundary-dominated slope gives the same volume with no pick at all.
- Tell a fault from a channel from a closed reservoir One well in six reservoirs that differ only beyond it: no boundary, a sealing fault, a constant-pressure boundary, two faults at a right angle, a channel and a closed circle. The derivatives side by side, the fault's distance from where its two semilog lines cross, and the drainage area from the closed reservoir's pseudosteady-state slope.
- Turn a buildup into a production rate A buildup read on the Horner plot for permeability, skin and p*, then those turned into a productivity index and an inflow curve, and the operating point against the tubing, as the well is and with its skin removed.
Material balance
- Fit the oil in place and the aquifer together Discovery and four yearly surveys of an oil reservoir with water drive: the oil in place a straight line gives with no aquifer, then the oil in place and a Fetkovich aquifer fitted jointly to the same withdrawal, and the drive indices that follow.
- Oil in place, gas cap and aquifer A Havlena–Odeh fit for oil in place and gas-cap size over the surveys before an aquifer arrives, then whatever is left over as water influx.
- Read the gas in place off a p/z plot Five pressure surveys of a volumetric gas reservoir against its cumulative production: the p/z line by least squares, the OGIP where it reaches zero with its standard error, and the recovery the line leaves at an abandonment pressure.
- Reconcile the decline EUR with the material balance A multi-module reserves study of a gas field after four years: the EUR from a decline fit to its rates, the gas in place from its p/z surveys, the recovery factor one implies of the other, the reservoir pressure the decline would leave, and what compression would add.
- Say what is driving the field Six surveys of an oil zone with a gas cap and a late aquifer: the depletion, gas-cap, water and compressibility drive indices at each survey, which split the withdrawal into the share each energy source supplied.
- Take the rock out of a geopressured p/z A gas reservoir discovered at 12,000 psia: the effective compressibility of its rock and connate water, the OGIP from the plain p/z and from the modified p/z that accounts for them, and how the answer moves with the formation compressibility.
SCAL
- Build water-oil relative permeability curves and their SWOF table Corey and LET water-oil relative permeability from the endpoints of a water-wet sandstone (Swi 0.20, Sorw 0.25, kro 0.85, krw 0.35), compared on one chart, with the Corey curves written out as an Eclipse SWOF table.
- Find a waterflood's front, breakthrough and recovery by Buckley–Leverett The fractional-flow curve of a measured relative permeability table under a 2 cP and a 20 cP oil, Welge's tangent to it, the shock-front saturation, the pore volumes injected at breakthrough, and the recovery behind the front as the water keeps coming.
- Scale a core plug's capillary pressure and read the transition zone A Brooks–Corey capillary pressure curve from a 100 mD core plug, carried to a 500 mD field rock by the Leverett J-function and turned into a saturation-height profile above the free water level, with the Big Butte table of Ahmed's Example 4-5 as a check.
- Watch a waterflood: voidage replacement, sweep and remaining oil Six yearly surveys of a waterflooded pattern (water injected, oil and water produced) read against the core's Buckley–Leverett displacement: the voidage replacement ratio, the volumetric sweep that matches the oil, the water-oil ratio it predicts, when the water broke through, and the mobile oil still in place.
Monte Carlo
Electric submersible pumps
- Find where a catalogue ESP runs on its well A catalogue pump curve, a number of stages and the well: where the pump's head meets the well's system curve, with the rate at the pump and in the stock tank, the total dynamic head, the intake pressure and how far the rate sits from the pump's best efficiency point, for 150 to 250 stages.
- Pick the drive frequency for an ESP on a variable-speed drive A catalogue pump curve carried to every drive frequency by the affinity laws and crossed with the well's system curve: the frequency that makes the most fluid inside the pump's efficiency band without overloading the motor, with the rate, head and horsepower at each frequency from 40 to 65 Hz.
- Size an ESP against the well's inflow Intake pressure, total dynamic head, stages and motor horsepower for a target rate.
Rod pumps
- Check a rod string's loads, stress and the unit's torque The loads a beam pump puts on its rods and its unit: rod weight in air and in the liquid, the fluid load, the peak and minimum polished rod loads by Mills' acceleration factors, the rod stress against the modified Goodman allowable, the ideal counterbalance and the peak gearbox torque, and how they all grow with the pumping speed.
- Size a rod pump's plunger for the rate What a beam pump actually delivers: the fluid load on the plunger, the rod and tubing stretch it causes, the overtravel from the rods' acceleration, the effective plunger stroke, and the production after fillage, for plungers from 1 1/4" to 2 1/4" with the tubing anchored and free.
Gas lift
- Find how much lift gas a well should take A gas lift design end to end: the well's inflow at today's and a later reservoir pressure, its tubing at each total GLR, and the lift gas that GLR takes at the rate the well settles at. Out comes the performance curve, oil rate against lift gas, with the natural-flow rate, the economic injection rate, the rate that gives the most oil, and whether the casing can inject at the tubing shoe.
- Set a lift valve's dome charge for the test rack An injection-pressure-operated lift valve, from the casing pressure it has to open at downhole to the nitrogen charge and test rack opening pressure the shop sets it to at 60 °F: the dome pressure at depth, the closing pressure, the spread, and how the opening pressure moves with the tubing pressure.
- Size the operating valve's port for the lift gas The injection side of a lift design: the casing pressure down the annulus from the surface injection pressure, the injection rate a target total GLR needs, and the smallest standard port whose Thornhill-Craver throughput passes that rate with a 20 % margin.
EOR
- CO₂ MMP with an impure injectant The pure-CO₂ minimum miscibility pressure, corrected for the nitrogen and methane in recycled gas.
- Design a polymer flood for a unit mobility ratio A 20 cP oil under a waterflood: the endpoint mobility ratio, the polymer viscosity and HPAM concentration that bring it to one, Pope's fractional-flow construction for the slug (oil bank, polymer front, adsorption and inaccessible pore volume), and the oil it recovers over the waterflood.
- Lower the residual oil with a surfactant slug The capillary number of a waterflood and of a Winsor III microemulsion slug, the slug's interfacial tension from its solubilization ratio by Huh, and the residual oil each leaves on the capillary desaturation curve.
- Predict CO₂ breakthrough and recovery with Koval's factor A miscible CO₂ flood of a 2 cP oil through a homogeneous core and a layered pattern: Koval's effective viscosity ratio, the heterogeneity factor from the Dykstra–Parsons coefficient, the pore volumes to solvent breakthrough and the displaceable oil recovered as CO₂ keeps coming.
- Size a steamflood's heated zone and its oil-steam ratio 1,000 bbl/d of 80 % quality steam at 500 psia into 30 ft of heavy-oil sand: the steam's temperature and the heat it carries, the Marx–Langenheim heated area and the share of the heat still in the sand year by year, and the Myhill–Stegemeier oil-steam ratio.
Hydraulic fracturing
- Predict what a frac job does for a well's productivity A tight oil well before and after a 100,000 lbm sand treatment: the length the treatment creates against Carter leakoff, the propped width and conductivity, the fracture's equivalent skin, the fold of increase and the rates before and after, and the same sand at the Unified Fracture Design optimum.
- Size a PKN fracture with Carter leakoff A 30 bbl/min, 100 cP gel treatment pumped for an hour into a 100 ft confined interval: the PKN length, wellbore width and net pressure without fluid loss and with a Carter leakoff coefficient, the fracture volume at shut-in and the fluid efficiency.
- Spend the proppant on the optimum fracture A fixed mass of proppant in a square drainage area: the proppant number, the optimal dimensionless conductivity, the length and propped width that give the highest productivity, and that maximum dimensionless productivity index. Then a tight-oil well swept from 25,000 to 1.6 million lbm.
Surface facilities
- Back-calculate the inlet pressure of a gas line A 4-in, 1-mile line carrying 16 MMscf/d of 0.65-gravity gas into a 969 psia header: the inlet pressure by the Weymouth, Panhandle A and Panhandle B equations, the drop along the line, the compressor discharge with a 1.1 safety factor, the gas velocity at each end, and the Weymouth inlet pressure as the rate grows.
- Back-calculate the upstream pressure at a gas choke A 32/64-in choke passing 5,000 Mscf/d of a 0.75-gravity gas at 110 °F into 300 psia: the upstream pressure the choke needs, whether the flow is sonic, the lowest upstream pressure that keeps it sonic and the rate there, and the upstream pressure for rates from 1,000 to 8,000 Mscf/d.
- Compare choke correlations against a measured rate A measured 720 bbl/d through a 32/64-in bean at 550 psia and a GLR of 900 scf/STB: the rate the Gilbert, Ros, Baxendell, Achong and Pilehvari correlations predict, each one's error against the measurement, the factor that calibrates Gilbert to it, and the Gilbert choke performance curves, rate against bean size, for wellhead pressures from 200 to 1,000 psia.
- Design the line from wellhead to separator 2,500 bbl/d of liquid at a GLR of 2,000 scf/STB from a well at 1,100 psia, through a choke and 8,000 ft of flowline to a 150 psia separator: for each line from 3 to 6 inches, the pressure the line needs at its inlet, whether the choke still runs critical against it, and the erosion ratio at the separator end; then the choke bean and the line that does both.
- Predict the pressure drop along a two-phase flowline A 5,000 ft, 4-in horizontal flowline carrying 1,500 bbl/d of liquid and 2.5 MMscf/d from 400 psia: the in-situ density, the no-slip liquid fraction and the holdup, the Eaton and Dukler gradients, the pressure along the line and at its end, the superficial velocities and the Mandhane and Baker flow regimes, the outlet pressure in 4 to 8-in pipe, and both correlations against Economides' worked examples.
- Size a wellhead choke for a target rate A well at 600 psia upstream of the choke and a GLR of 1,000 scf/STB, to produce 800 bbl/d of liquid: the Gilbert choke size, the bean in stock for it and the rate that bean passes, the check that the choke runs critical against a 250 psia flowline, and the bean schedule as the wellhead pressure declines.
- Tell critical from subcritical choke flow A 32/64-in choke with 1,000 psia upstream and 400 psia downstream, passing a 35 °API oil at a GLR of 1,000 scf/STB: the pressure ratio against the 0.55 rule of thumb, the Sachdeva critical pressure ratio for this fluid, the rate, the highest downstream pressure the choke stays critical at, and the rate as the downstream pressure rises to the upstream.
Flow assurance
- Dose methanol or MEG to keep a flowline out of hydrates A 0.7-gravity sweet gas in a subsea flowline at 1,000 psia and a 40 °F seabed: the hydrate formation temperature, the subcooling, the depression a 5 °F margin needs, the methanol or MEG concentration that gives it by Hammerschmidt, and the injection rate for 100 bbl/d of produced water.
- Predict CO2 corrosion and the wall a flowline needs A wet carbon-steel flowline at 1,000 psia and 140 °F with 2 mol% CO₂: the CO₂ partial pressure, the de Waard–Milliams bare-steel corrosion rate, the rate behind an inhibitor from 80 to 98 % efficient, and the wall it eats over a 20-year life.
- Size a flowline below its erosional velocity A two-phase flowline carrying 8.0 ft³/s of vapour and 2.5 ft³/s of liquid at flowing conditions: the no-slip mixture density, the API RP 14E erosional velocity, the velocity and erosion ratio in a 4-inch line, the minimum internal diameter, and the ratio in schedule 40 pipe from 4 to 12 inches.
- Size a subsea tieback for hydrates, erosion and corrosion A 5-mile subsea tieback carrying 20 MMscf/d and 1,000 bbl/d of liquid to a platform at 800 psia: the wellhead pressure that 4, 6 and 8-inch lines need, the erosion ratio at the cold arrival, the hydrate subcooling and CO₂ corrosion at both ends of the chosen line, and the methanol that keeps it out of hydrates.
Process
- Choke a wellstream and separate it in three stages A light-oil wellstream at 100 bar and 70 °C through a choke into an HP separator at 30 bar, its liquid let down to an LP separator at 4 bar and on to the stock tank: the choke cooling, each stage's temperature, vapour and liquid, the total GOR, the stock-tank oil rate and gravity, and the mass and energy balance of the train.
- Find the water a saturated sales gas carries A lean sales gas, 50 MMscf/d of 90 % methane, saturated with water from 40 to 140 °F at 500, 1000 and 2000 psia: its water content in lb/MMscf, and the water a dehydration unit has to take out to meet a 7 lb/MMscf pipeline spec.
- Flash a wellstream and read its phases A light-oil wellstream, 1,000 kmol/h of nitrogen through n-eicosane, flashed at the HP separator's 30 bar and 66.5 °C: each phase's mole fraction, molar mass, density, viscosity and flows, and the PH flash that gives the vapour's temperature back from its enthalpy.
- Size the export compressor and its coolers The HP separator's vapour, 2.4 kg/s at 30 bar and 66.5 °C, compressed to 100 bar for export at 75 % isentropic efficiency: one stage with an aftercooler against two equal-ratio stages with an intercooler and scrubber, with the heads, shaft power, discharge temperatures and cooler duties, and the HP liquid pumped to the same 100 bar.
- Stabilise a condensate in a reboiled column An unstabilised condensate, 100 kmol/h of methane through n-heptane at 40 °C and 10 bar, fed to the top of a six-stage reboiled stabiliser at 10 bar: the stage profile, the reboiler duty and temperature, where each component goes, and the bottoms' true vapour pressure at 100 °F across a sweep of boilup ratios.