Exerciseschevron_rightChapter 1chevron_right1.4
fitness_center

Exercise 1.4

Bottomhole Pressure Report

Level 2
Chapter 1: Python Setup for Petroleum Engineering
descriptionProblem

The bottomhole pressure (BHP) in a well is the sum of surface pressure and the hydrostatic pressure of the mud column:

BHP=Psurface+0.052×MW×TVDBHP = P_{surface} + 0.052 \times MW \times TVD

Calculate BHP for three drilling scenarios:

ScenarioSurface Pressure (psi)Mud Weight (ppg)TVD (ft)
Normal drilling20010.08,000
High-pressure zone50014.012,000
Shallow well1008.63,500

For each scenario, produce a dict with these exact keys:

  • name: the scenario label
  • bhp: total bottomhole pressure in psi
  • hydro: the hydrostatic component in psi
  • hydro_pct: percentage of BHP coming from hydrostatic pressure alone

Store the three dicts in the order shown above in a list called scenarios.

> Think about it: in which scenario does surface pressure matter most > relative to total BHP, and why? When would a drilling engineer choose > to deliberately apply surface pressure rather than rely on the mud column > alone?

lightbulbHints (0/3)

Stuck? Reveal hints one at a time — they progress from nudge to near-solution.

codeYour solution
main.py
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.

inputs = [
    ("Normal drilling",     200, 10.0,  8000),
    ("High-pressure zone",  500, 14.0, 12000),
    ("Shallow well",        100,  8.6,  3500),
]

def scenario(name, ps, mw, tvd):
    hydro = 0.052 * mw * tvd
    bhp = ps + hydro
    return {
        "name": name,
        "bhp": bhp,
        "hydro": hydro,
        "hydro_pct": hydro / bhp * 100,
    }

scenarios = [scenario(*row) for row in inputs]
for row in scenarios:
    print(f"{row['name']:<20} BHP={row['bhp']:.0f} psi  hydro={row['hydro_pct']:.1f}%")

lockCopying code is a Full Access feature.