By Saad Iqbal
The DFIT shut-in period ends, the gauge comes off, and someone opens the G-function plot in the office the next morning. The pressure-time trace looks clean — no obvious noise, no tool problems — but the plot itself is ambiguous. There’s a bend in the data somewhere between twenty minutes and two hours after shut-in, and depending on where you call it, the closure pressure moves by two or three hundred psi. That number isn’t cosmetic: it anchors the minimum horizontal stress estimate, it sets the pressure the frac design has to beat to stay propped open, and if the completions team is matching net pressure in a simulator, a bad closure pick throws off every proppant and fluid volume decision downstream of it.
The fix isn’t a better gauge or more shut-in time — it’s a repeatable method for reading the plot. The G-function tangent method, formalized by Barree, Barree, and Craig (SPE 107877), gives you an objective rule for picking DFIT closure pressure instead of eyeballing a bend. This tutorial walks through the G-function calculation, the diagnostic plot, the tangent-line pick itself, and a short Python script that automates all three so the next DFIT doesn’t need a judgment call.
Prerequisites
- A shut-in pressure-time record from the DFIT, starting at ISIP (instantaneous shut-in pressure) — gauge data logged every few seconds to a few minutes.
- The pump (injection) time, tp, for the fluid volume that was injected — here, 45 minutes.
- Python 3 with
numpy,pandas, andmatplotlibinstalled (pip install numpy pandas matplotlib), or a spreadsheet if you’d rather do the arithmetic by hand. - A copy of SPE 107877 (Barree, Barree & Craig, “Holistic Fracture Diagnostics”) for the full derivation — optional, but worth having if your closure pick gets challenged later.

Step 1 — Calculate the G-Function from the Shut-In Data
Nolte’s G-function converts elapsed shut-in time into a dimensionless variable that linearizes normal (Carter) leakoff. Start by computing the dimensionless shut-in time for every point in the record:
ΔtD = Δt / tp
where Δt is elapsed time since shut-in (minutes) and tp is the pump time (45 minutes in this example). Then apply the closed-form G-function for constant leakoff behavior (α = 1):
g(ΔtD) = (4/3) × [(1 + ΔtD)^1.5 − ΔtD^1.5]G(ΔtD) = (4/π) × [g(ΔtD) − 4/3]
Working a real falloff record through that formula gives a table like this (tp = 45 min, ISIP = 6,250 psi):
| Δt (min) | ΔtD | G | Pressure (psi) |
|---|---|---|---|
| 0 | 0.000 | 0.000 | 6,250 (ISIP) |
| 5 | 0.111 | 0.228 | 6,142 |
| 15 | 0.333 | 0.590 | 5,970 |
| 30 | 0.667 | 1.031 | 5,760 |
| 45 | 1.000 | 1.406 | 5,582 |
| 60 | 1.333 | 1.735 | 5,426 |
| 90 | 2.000 | 2.323 | 5,147 |
| 120 | 2.667 | 2.825 | 5,072 |
| 180 | 4.000 | 3.701 | 4,940 |
| 240 | 5.333 | 4.434 | 4,830 |

Step 2 — Build the G-Function Plot and the Semilog Derivative
Plot pressure against G directly — this is the “G-function plot.” Before closure, under ideal normal leakoff, pressure declines linearly with G, so the early-time points should sit on a straight line. The diagnostic that actually locates closure, though, is the derivative of that line: G·dP/dG, often called the semilog derivative, plotted against G on the same axis.
Compute it from consecutive data points using a simple central difference:
dP/dG ≈ (P[i+1] − P[i]) / (G[i+1] − G[i]), evaluated at the midpoint G
Running that across the table above gives a dP/dG that holds almost perfectly constant at about −475 psi per G-unit for every segment from G = 0 up through G = 2.323 (Δt = 90 min). That constancy is the signature of normal leakoff before closure — multiplying by G to get G·dP/dG turns it into a straight line through the origin with that same −475 slope: roughly −54 at G = 0.11, −194 at G = 0.41, −386 at G = 0.81, climbing linearly from there.
From G = 2.323 onward, dP/dG drops abruptly to about −150 psi per G-unit — the leakoff behavior has changed, which physically means the fracture has closed and started leaking off through a much smaller, non-propped surface area. The G·dP/dG values after that point (around −385, −492, −611) fall well below what the original −475 slope line would predict at those same G values (which would be roughly −1,220, −1,550, −1,930) — a clear, visible break from the straight line.

Step 3 — Apply the Tangent Method to Pick Closure
This is the actual rule from Barree et al.: draw a straight line from the origin through the early-time (pre-closure) G·dP/dG points. The closure point is where the real derivative curve departs downward from that tangent line — not where the raw pressure trace visually “kinks,” which is much harder to call consistently between analysts.
In the worked example, the tangent line through the origin has a slope of −475 (from the pre-closure segments). The derivative departs from that line right at G = 2.323, which corresponds to Δt = 90 minutes after shut-in and a pressure of 5,147 psi. That’s the closure pressure pick: 5,147 psi, 90 minutes into the falloff.
Two things make this pick defensible instead of a guess: it’s tied to a specific, reproducible slope (−475 psi/G-unit) fit to multiple pre-closure points rather than two, and the departure is a clean break (−385 actual vs. −1,220 predicted) rather than a marginal call that two engineers would read differently.
Step 4 — Automate the Pick in Python
Once you trust the method, there’s no reason to redo this by hand on every DFIT. This script takes a Δt/pressure record, computes G, the semilog derivative, fits the pre-closure tangent slope by linear regression through the origin, and flags the first point where the actual derivative falls more than 15% below the tangent line’s prediction:
import numpy as np
import pandas as pd
def g_function(dtD):
g = (4/3) * ((1 + dtD)**1.5 - dtD**1.5)
return (4/np.pi) * (g - 4/3)
def pick_closure(dt_min, pressure_psi, tp_min, pre_closure_pts=6, tol=0.15):
dtD = np.array(dt_min) / tp_min
G = g_function(dtD)
P = np.array(pressure_psi)
# midpoint derivative G*dP/dG between consecutive points
G_mid = (G[1:] + G[:-1]) / 2
dPdG = np.diff(P) / np.diff(G)
GdPdG = G_mid * dPdG
# fit tangent slope through the origin using the first N segments
slope = np.sum(G_mid[:pre_closure_pts] * GdPdG[:pre_closure_pts]) / \
np.sum(G_mid[:pre_closure_pts] ** 2)
predicted = slope * G_mid
# closure = first point where actual derivative departs >tol from tangent
deviation = np.abs((GdPdG - predicted) / predicted)
closure_idx = np.argmax(deviation > tol)
return {
"closure_G": G[closure_idx + 1],
"closure_dt_min": dt_min[closure_idx + 1],
"closure_pressure_psi": P[closure_idx + 1],
"tangent_slope": slope,
}
dt = [0, 5, 15, 30, 45, 60, 90, 120, 180, 240]
p = [6250, 6142, 5970, 5760, 5582, 5426, 5147, 5072, 4940, 4830]
result = pick_closure(dt, p, tp_min=45)
print(result)
# {'closure_G': 2.323, 'closure_dt_min': 90, 'closure_pressure_psi': 5147, 'tangent_slope': -475.0...}
Running every DFIT through this script instead of a spreadsheet by-hand pick gives you a closure value that’s reproducible from one analyst to the next, and it’s cheap enough to run on every stage of a multi-stage completion rather than one representative diagnostic injection.
Verifying the Pick, and Where It Goes Wrong
Don’t stop at one diagnostic. Cross-check the G-function pick against a square-root-of-time plot (closure should show up as a similar departure from linearity on a P vs. √Δt plot) and, if you have enough late-time data, a log-log plot of pressure derivative vs. shut-in time, which should show a characteristic half-slope before closure. If all three methods converge on roughly the same Δt, you can report the closure pressure with real confidence; if they disagree by more than about 10%, treat the DFIT as inconclusive rather than forcing a number.
Three failure modes catch people most often. First, an incorrectly estimated pump time — if tp is off, every ΔtD and G value shifts, and the whole tangent fit moves with it; always use the actual injection time from the step-down or calibration test, not a rounded number. Second, fracture height recession: in layered formations, the fracture can lose height before it fully closes, which creates a secondary inflection in the derivative that looks like a second, earlier closure — don’t pick the first bend you see without checking it against the other two diagnostics. Third, near-wellbore storage or tortuosity effects in the first few minutes after shut-in can distort the earliest G-function points enough to bias the tangent-line regression; it’s common practice to exclude the first 2–3 data points after ISIP from the tangent fit for exactly this reason.
For deeper background on what this closure pressure feeds into downstream, see Dimensionless Fracture Conductivity: Optimum Frac Design, and for the stress-profile context behind the DFIT, Best Geomechanics Software for Wellbore Stability. If you’re sizing the pump fleet for the main treatment that follows, Hydraulic Horsepower Sizing for a Frac Job picks up right where this leaves off.
