PO.SF.PL.Liq.Size


Description

Returns the smallest pipe internal diameter, from a list of candidate sizes, that carries a liquid rate from an inlet pressure to a minimum delivery pressure, the elevation change included, without exceeding a velocity limit. It sweeps the list smallest first with the shipped Darcy-Weisbach functions and stops at the first size that passes both tests. The roughness is the wall's absolute roughness, so each size takes its own relative roughness ε/D. A sheet reads the nominal size with `INDEX(nps, MATCH(size, ids, 0))`.

Formula

=LAMBDA(ql, rho, mu, length, eps, dh, p_in, p_min, v_max, ids, IF(OR(ql<=0, rho<=0, mu<=0, length<=0, eps<0, p_in<=0, p_min<0, v_max<=0), NA(), LET( ok, MAP(ids, LAMBDA(x, IF(PO.SF.PL.Liq.Vel(ql, x)>v_max, 0, IF(IFERROR(PO.SF.PL.Liq.Pout(p_in, ql, rho, mu, x, length, eps/x, dh), p_min-1)>=p_min, 1, 0)))), k, IFERROR(XMATCH(1, ok), 0), IF(k=0, NA(), INDEX(ids, k)))))

Parameters

Parameter Unit Description
ql bbl/d Liquid rate
rho lb/ft³ Liquid density
mu cp Liquid viscosity at line temperature
length ft Line length
eps in Absolute wall roughness (0.0018 in for commercial steel)
dh ft Elevation change, outlet minus inlet; negative downhill
p_in psi Inlet pressure (the pump discharge)
p_min psi Minimum delivery pressure, on the same gauge or absolute basis as `p_in`
v_max ft/s Highest velocity allowed (15 ft/s is the usual limit for liquid lines)
ids in Candidate internal diameters as a column, smallest first

Examples

Invocation Expected
=PO.SF.PL.Liq.Size(1500, 55.56, 2.72, 10560, 0.0018, 100, 285, 50, 15, {2.067;3.068;4.026;6.065;7.981;10.02;12}) 2.067
=PO.SF.PL.Liq.Size(1500, 55.56, 2.72, 26400, 0.0018, 100, 285, 50, 15, {2.067;3.068;4.026;6.065;7.981;10.02;12}) 3.068
=PO.SF.PL.Liq.Size(1500, 55.56, 2.72, 10560, 0.0018, 100, 285, 50, 3, {2.067;3.068;4.026;6.065;7.981;10.02;12}) 3.068
=PO.SF.PL.Liq.Size(1500, 55.56, 2.72, 10560, 0.0018, 300, 285, 50, 15, {2.067;3.068;4.026;6.065;7.981;10.02;12}) 3.068
=PO.SF.PL.Liq.Size(20000, 55.56, 2.72, 10560, 0.0018, 100, 285, 50, 15, {2.067;3.068;4.026;6.065;7.981;10.02;12}) 6.065

Need a custom LAMBDA? Suggest a New Lambda