Exercise 2.1
Formation Pressure Gradient
The formation pressure gradient is the pore pressure divided by the true vertical depth, expressed in psi/ft. The normal hydrostatic gradient ranges from 0.433 psi/ft (freshwater) to 0.465 psi/ft (saltwater). Gradients above 0.465 indicate an overpressured formation, one of the most dangerous conditions in drilling, because the mud weight you'd normally use is suddenly not enough to balance the pore pressure.
Write a function pressure_gradient(pore_pressure_psi, tvd_ft) that:
- Computes the gradient in psi/ft.
- Classifies the formation as one of:
"Underpressured"(< 0.433 psi/ft)"Normal"(0.433 – 0.465 psi/ft, inclusive)"Overpressured"(> 0.465 psi/ft)
- Returns a tuple
(gradient, classification).
Test it with: (a) 4,200 psi at 10,000 ft, (b) 6,800 psi at 11,500 ft, (c) 1,600 psi at 5,000 ft. For each, what would the classification mean in practical drilling terms?
Stuck? Reveal hints one at a time — they progress from nudge to near-solution.
visibilityReveal reference solutionexpand_more
Try solving it yourself first — the hints walk you through it. The solution below is one valid approach; yours may differ and still be correct.
def pressure_gradient(pore_pressure_psi, tvd_ft):
gradient = pore_pressure_psi / tvd_ft
if gradient < 0.433:
cls = "Underpressured"
elif gradient <= 0.465:
cls = "Normal"
else:
cls = "Overpressured"
return gradient, cls
for p, d in [(4200, 10000), (6800, 11500), (1600, 5000)]:
g, c = pressure_gradient(p, d)
print(f"{p:>5} psi @ {d:>6,} ft → {g:.4f} psi/ft ({c})")
lockCopying code is a Full Access feature.