Spline Interpolation of a PVT Table
Interpolates a PVT table between its points by cubic spline and straight lines, with the slope and mean value over an interval.
Utilities 69 rows × 4 columns
Use this blueprint
How to use this blueprint
- In Excel, go to the Petroleum Office ribbon tab and click Blueprint Manager
- Search for Spline Interpolation of a PVT Table
- Click on the blueprint to preview
- Click Insert to place it into your worksheet. Modify the input values to match your data.
Requires the Petroleum Office add-in for Excel.
Description
What does a PVT table read between its points? You enter a table of oil formation volume factor against pressure, as a PVT report lists it, a pressure to read it at, an interval to average over and a tolerance. You read off Bo at that pressure by natural cubic spline and by straight lines between the points, the slope dBo/dp by both, and the mean Bo over the interval, the integral of Bo over it divided by its width.
Parameters:
- Table: pressure and Bo, one point per row, pressures rising, named
SPL_TPandSPL_TBo - Query: the pressure to read Bo at,
SPL_P - Interval: the pressures to average Bo between,
SPL_P1andSPL_P2 - Tolerance: the relative cubic-linear difference that warns,
SPL_Tol
How to use it: Paste the differential liberation's or a correlation's Bo against pressure, one point per row with the pressures rising, all on one side of the bubble point. Bo turns at the bubble point, so a table across it needs splitting there: a spline through the kink overshoots on both sides. The same sheet reads any smooth table: Rs, μo, a gas Z-factor or Bg against pressure. A grid across the table and a chart show the table's points with both interpolants and their difference. Checks flag a table whose pressures don't rise, a query or interval outside the table, where a spline extrapolates, and a query where the two interpolants part by more than the tolerance, a sign the table is too coarse there.
Method: A natural cubic spline passes a cubic through each pair of neighbouring points, with the slopes and curvatures matched where the pieces meet and zero curvature at both ends. Solving for the curvature Mi at each point is a tridiagonal system; between xi and xi+1, with h = xi+1 − xi, A = (xi+1 − x)/h and B = 1 − A, S(x) = A·yi + B·yi+1 + ((A³ − A)·Mi + (B³ − B)·Mi+1)·h²/6. Linear interpolation is S(x) = yi + (yi+1 − yi)(x − xi)/h. The slope is the derivative of each interpolant, piecewise constant for the linear one, and the mean Bo over [p1, p2] is ∫Bo dp/(p2 − p1), exact for each piece. Past the table's ends each interpolant carries its end piece on, an extrapolation, so the range check warns.
Example: The default table is the PVT family's reference black oil: oil 2 of Ahmed's six crude-oil systems, 40.7 °API with a 0.855 gravity gas and 768 scf/STB at 220 °F. Its Bo below the 2,503 psi bubble point that Standing's correlation gives is Standing's saturated Bo at Standing's solution gas-oil ratio, listed every 350 psi from 400 to 2,500 psi to four decimals. The Black-Oil PVT Table sheet computes the same oil.
At 1,000 psi the cubic spline reads Bo = 1.2102 bbl/STB and linear interpolation 1.2109; Standing's correlation itself gives 1.2103, so the cubic is within 0.01 % and the linear 0.05 % high, since straight lines cut the inside of a curve that bends upward. Linear less cubic is 0.0007 bbl/STB, 0.057 %, inside the 0.1 % tolerance, so the interpolation check passes. The slope dBo/dp is 1.617 × 10⁻⁴ bbl/STB/psi by the cubic and 1.571 × 10⁻⁴ by the linear one, the chord of the 750 to 1,100 psi piece. Between 1,100 and 1,800 psi the mean Bo is 1.2882 by the cubic and 1.2886 by straight lines. The table and range checks pass. A hand computation of the natural spline gives the same 1.21019 and 1.6166 × 10⁻⁴.
Functions used
PO.Spline.Cubic.InterpCalculates interpolated value using natural cubic spline interpolation.PO.Spline.Linear.InterpCalculates interpolated value using linear spline interpolation. Outside the x range it extends the first or last segment.PO.Spline.Cubic.DiffCalculates first derivative using natural cubic spline interpolation.PO.Spline.Linear.DiffCalculates first derivative using linear spline interpolation.PO.Spline.Cubic.IntegT1T2Calculates definite integral using natural cubic spline interpolation from point t1 to point t2.PO.Spline.Linear.IntegT1T2Calculates definite integral using linear spline interpolation from point t1 to point t2.
Names it defines (31)
| Name | Refers to | Comment |
|---|---|---|
SPL_P |
$B$4 |
Pressure to read Bo at, psi |
SPL_P1 |
$B$5 |
Interval to average Bo over, from, psi |
SPL_P2 |
$B$6 |
Interval to average Bo over, to, psi |
SPL_Tol |
$B$7 |
Cubic-linear difference that warns, % |
SPL_Inputs |
$B$4:$B$7 |
The pressure to read the table at, the interval to average Bo over, and the cubic-linear difference that warns |
SPL_BoCubic |
$B$10 |
Bo by natural cubic spline, bbl/STB |
SPL_BoLinear |
$B$11 |
Bo by linear interpolation, bbl/STB |
SPL_Diff |
$B$12 |
Linear less cubic, bbl/STB |
SPL_Apart |
$B$13 |
Cubic and linear apart, relative, % |
SPL_SlopeCubic |
$B$14 |
Slope dBo/dp by cubic spline, bbl/STB/psi |
SPL_SlopeLinear |
$B$15 |
Slope dBo/dp by linear interpolation, bbl/STB/psi |
SPL_MeanCubic |
$B$17 |
Mean Bo by cubic spline, ∫Bo dp/(p2 − p1), bbl/STB |
SPL_MeanLinear |
$B$18 |
Mean Bo by linear interpolation, bbl/STB |
SPL_PMin |
$B$19 |
Lowest pressure in the table, psi |
SPL_PMax |
$B$20 |
Highest pressure in the table, psi |
SPL_Points |
$B$21 |
Points in the table |
SPL_TableCheck |
$B$22 |
Table check verdict |
SPL_TableCheckNote |
$C$22 |
Table check comment |
SPL_RangeCheck |
$B$23 |
Range check verdict |
SPL_RangeCheckNote |
$C$23 |
Range check comment |
SPL_Check |
$B$24 |
Interpolation check verdict |
SPL_CheckNote |
$C$24 |
Interpolation check comment |
SPL_Results |
$B$10:$B$24 |
Bo at the query by cubic spline and linear interpolation, their difference, the slope dBo/dp by both, the mean Bo over the interval by both, the table's range and size, and the three checks |
SPL_Table |
$A$30:$B$36 |
The PVT table: pressure and Bo, one point per row, pressures rising |
SPL_TP |
$A$30:$A$36 |
Table pressures, psi |
SPL_TBo |
$B$30:$B$36 |
Table Bo, bbl/STB |
SPL_TP1 |
$A$30:$A$35 |
Table pressures but the last, psi |
SPL_TP2 |
$A$31:$A$36 |
Table pressures but the first, psi |
SPL_Curve |
$A$41:$D$65 |
Pressures across the table in equal steps, with Bo by cubic spline and by linear interpolation and their difference |
SPL_Steps |
$B$68 |
Steps of the grid across the table |
SPL_MinPoints |
$B$69 |
Fewest points a cubic spline takes |
Details
| Inserts | 69 rows × 4 columns |
| Category | Utilities |
| For agents and tools | Descriptor (.md) |
| Tags | spline · interpolation · cubic · linear · differentiation · integration · pvt · formation-volume-factor |
Need a custom calculation? Request a blueprint

