Exerciseschevron_rightChapter 15chevron_right15.6
fitness_center

Exercise 15.6

Looped Pipeline - Debottlenecking with a Parallel Line

Level 3
Chapter 15: Gas Engineering
descriptionProblem

An existing 20-inch pipeline can deliver 120 MMscf/d. Demand has increased to 180 MMscf/d. Calculate the diameter of a parallel (looped) line that, combined with the existing line, meets the new demand. Compare the cost of looping with the cost of replacing the entire line with a single larger pipe.

---

An OML-tariff gas line on the Niger Delta trunk system has been debottlenecked the smart way for decades: instead of digging up a healthy 20-inch pipe, you lay a shorter parallel loop alongside it. Two pipes between the same two pressures simply add their capacities, so you only need a loop big enough to carry the deficit, not the whole demand.

The key physics comes straight from the embedded Weymouth equation: at fixed P1, P2, and length L, capacity scales as

q  ∝  sqrt(D**(16/3))  =  D**(8/3)

So to add a capacity q_loop next to an existing line of diameter D_existing that already carries q_existing, invert the exponent:

D_loop = D_existing * (q_loop / q_existing) ** (3/8)

and the single full-replacement pipe that would have to carry the entire demand on its own is

D_single = D_existing * (q_demand / q_existing) ** (3/8)

The verified weymouth(P1, P2, D_in, L_miles, gamma_g, T_avg_F, Z_avg, E=0.92) function is embedded for you; do not modify it or re-derive the correlation.

Your task:

  1. Write loop_design(D_existing, q_existing, q_demand) returning a dict with:
  • 'q_loop': the extra capacity (MMscf/d) the loop must add,

i.e. q_demand - q_existing.

  • 'D_loop': the loop diameter (in) from the (3/8) scaling above.
  • 'D_single': the single full-replacement diameter (in) that alone carries

q_demand.

  1. Using the embedded book constants

D_EXISTING = 20.0 (in), Q_EXISTING = 120.0 (MMscf/d), Q_DEMAND = 180.0 (MMscf/d), call: ``python ld = loop_design(D_EXISTING, Q_EXISTING, Q_DEMAND) d_loop = ld['D_loop'] d_single = ld['D_single'] q_loop = ld['q_loop'] ``

> Think about it: the loop only has to add the 60 MMscf/d shortfall, so it > comes out smaller than the existing 20-inch line, while the lone replacement > pipe must beat the existing line outright. Two modest pipes carry more total > capacity than one pipe of their summed diameter; that D**(8/3) non-linearity > is exactly why looping wins on steel and cost. Why does D_single end up > less than D_existing + D_loop?

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.

import numpy as np


# ── Verified Weymouth pipeline-capacity equation (do not edit) ───────────
def weymouth(P1, P2, D_in, L_miles, gamma_g, T_avg_F, Z_avg, E=0.92):
    """Weymouth equation for gas pipeline capacity (MMscf/day)."""
    Tb = 520
    Pb = 14.73
    T_R = T_avg_F + 459.67

    q = 433.5 * (Tb/Pb) * E * (
        (P1**2 - P2**2) * D_in**(16/3) /
        (gamma_g * T_R * Z_avg * L_miles)
    )**0.5

    return q / 1e6


# ── Book constants for Exercise 15.6 (do not edit) ───────────────────────
D_EXISTING = 20.0    # existing pipeline inner diameter, in
Q_EXISTING = 120.0   # existing deliverable capacity, MMscf/d
Q_DEMAND = 180.0     # new required demand, MMscf/d


def loop_design(D_existing, q_existing, q_demand):
    """Size a parallel (looped) line to meet a higher gas demand.

    Parallel pipes between the same two pressures ADD their capacities, and
    Weymouth capacity scales as q ~ D**(8/3) at fixed P1, P2, L. Returns a dict:
      'q_loop'   = q_demand - q_existing (MMscf/d the loop must add)
      'D_loop'   = D_existing * (q_loop  / q_existing)**(3/8)  (in)
      'D_single' = D_existing * (q_demand / q_existing)**(3/8) (in)
    """
    q_loop = q_demand - q_existing
    D_loop = D_existing * (q_loop / q_existing) ** (3/8)
    D_single = D_existing * (q_demand / q_existing) ** (3/8)
    return {'q_loop': q_loop, 'D_loop': D_loop, 'D_single': D_single}


ld = loop_design(D_EXISTING, Q_EXISTING, Q_DEMAND)
d_loop = ld['D_loop']
d_single = ld['D_single']
q_loop = ld['q_loop']

print("loop capacity needed (MMscf/d):", q_loop)
print("loop diameter (in):", d_loop)
print("single-replacement diameter (in):", d_single)

lockCopying code is a Full Access feature.