CalcPlant calculation theory
Equations and assumptions for pipe losses, pump head, NPSHa, and liquid, vapour and two-phase calculations. Vapour uses an isothermal pressure-loss model; two-phase flow combines selected friction with Beggs & Brill holdup, gravity and acceleration corrections. Sources, applicability and implementation approximations are stated in each section.
0. Symbols and units
In the friction and momentum equations below, μ is in Pa·s and ε and D are both in m; the entered ε (mm) is divided by 1000. log is log10 (Math.log10), ln is the natural log (Math.log). [R1]
1. Flow
- Where flow is entered: flow is given per line in the line list, as m³/h or kg/h. There is no drawing-wide flow; a line leaving a vessel must carry its own flow, otherwise the path reports "flow undefined".
- Mass vs. volume: a typed kg/h wins over a typed m³/h. For liquid lines it is converted with that line's own density,
Q = W/ρline. - Continuity: a blank line takes the flow arriving at its upstream item. At a split, exactly one blank outlet takes the remainder (inflow − specified outlets); more than one blank outlet is an error, and a mismatch beyond 0.5 % is flagged.
- Design margin scales only that line's own flow and is never passed on downstream.
- Line fluid: density and viscosity are per line and required on every calculated liquid line; there is no fallback to a drawing-wide fluid.
Vapour and two-phase lines are calculated on mass flow. A vapour line has no liquid density, so it needs its own kg/h; the cell is marked "Required" in the line list until a mass flow is available.
2. Liquid friction loss Darcy–Weisbach
Friction factor
- Laminar (Re < 2300): f = 64/Re. For 2300–4000, linear blend between 64/Re at 2300 and Colebrook at 4000 (pump path and liquid lines). Any line in this band raises a "transitional" warning.
- Vapour lines use 64/Re for Re ≤ 4000 and Colebrook above (§5); two-phase friction depends on the selected method (§6).
Fitting and valve losses
Fitting and valve losses are added to friction through resistance coefficients K, evaluated per line with that line's Reynolds number and size.
K method one choice for the whole drawing (line properties → valves · fittings → Fitting K method)
- Re term (Km/Re, K1/Re): raises K at low Re. Liquid lines use the line Re, vapour lines Re = G·D/μG. Two-phase lines drop the Re term (fully turbulent values).
- Size term: 2-K scales with (1 + 1/ID), 3-K with (1 + Kd/Dn0.3), so the same fitting has a larger K in a smaller pipe. Crane reflects size only through fT.
- Difference from Crane: Crane K is a fully turbulent value independent of Re, so it understates losses at low Re and in laminar flow; 2-K and 3-K carry on into laminar flow through the Re term. Darby reports 3-K fitting data better than 2-K over a wide range of Re and sizes. [R11]
- Missing values: a fitting missing from the chosen table uses the other table (butterfly, tilting-disc check and reduced-trim ball use 2-K under 3-K; r/D 2·4·6 bends and plug valves use 3-K under 2-K). Under Crane, a fitting without an L/D uses 3-K (else 2-K). Crane L/D values are the existing defaults (90° elbow 30, gate 8, …) and the (L/D)eq column of Darby's table.
- Equipment: heat exchangers, filters, control valves and flow elements add their entered ΔP, not a K.
Worked example example suction line: 3" Sch 40, Re 115,774, entrance 1 + gate 1 + 90° elbow 3
| Item | 3-K | 2-K | Crane |
|---|---|---|---|
| Entrance | 160/Re + 0.5 = 0.5014 | 0.5014 | 0.5 |
| Gate valve | 300/Re + 0.037(1 + 3.9/30.3) = 0.1434 | 300/Re + 0.10(1 + 1/3.067) = 0.1352 | 8 × 0.01734 = 0.1387 |
| 90° elbow × 3 | 3 × [800/Re + 0.091(1 + 4.0/30.3)] = 1.0791 | 3 × [800/Re + 0.25(1 + 1/3.067)] = 1.0153 | 3 × 30 × 0.01734 = 1.5606 |
| ΣK | 1.7239 | 1.6519 | 2.1994 |
| Example pump head | 36.29 m | 36.34 m | 36.67 m |
The app's values match this hand calculation (ID 77.93 mm = 3.067 in, ε 0.046 mm, fT = 0.01734).
Fitting constants main eleven + more fittings · valves
| Fitting | 2-K: K₁ / K∞ | 3-K: Km / Ki / Kd | Crane L/D |
|---|---|---|---|
| Gate valve | 300 / 0.10 | 300 / 0.037 / 3.9 | 8 |
| Globe valve | 1500 / 4.0 | 1500 / 1.70 / 3.6 | 340 |
| Ball valve | 300 / 0.10 | 300 / 0.017 / 4.0 | 3 |
| Butterfly | 800 / 0.25 | (uses 2-K) | 45 |
| Swing check | 1500 / 1.50 | 1500 / 0.46 / 4.0 | 100 |
| 90° elbow std (flanged/welded) | 800 / 0.25 | 800 / 0.091 / 4.0 | 30 |
| 45° elbow std | 500 / 0.20 | 500 / 0.071 / 4.2 | 16 |
| Tee run (flanged) | 250 / 0.05 | 150 / 0.017 / 4.0 | 20 |
| Tee branch (flanged) | 800 / 0.80 | 800 / 0.28 / 4.0 | 60 |
| Entrance | 160/Re + 0.5 | 160/Re + 0.5 | K 0.5 |
| Exit | K = 1.0 | K = 1.0 | K 1.0 |
| 90° elbow, long radius (r/D 1.5) | 800 / 0.20 | 800 / 0.071 / 4.2 | 16 |
| 90° elbow, threaded std | 800 / 0.40 | 800 / 0.14 / 4.0 | 30 |
| 90° bend r/D 2 | (uses 3-K) | 800 / 0.056 / 3.9 | 12 |
| 90° bend r/D 4 | (uses 3-K) | 800 / 0.066 / 3.9 | 14 |
| 90° bend r/D 6 | (uses 3-K) | 800 / 0.075 / 4.2 | 17 |
| 90° mitre, 1 weld | 1000 / 1.15 | 1000 / 0.27 / 4.0 | 60 |
| 90° mitre, 2 welds (45°) | 800 / 0.35 | 800 / 0.068 / 4.1 | 15 |
| 90° mitre, 3 welds (30°) | 800 / 0.30 | 800 / 0.035 / 4.2 | 8 |
| 90° mitre, 4 welds (22.5°) | 800 / 0.27 | (uses 2-K) | (3-K/2-K value) |
| 90° mitre, 5 welds (18°) | 800 / 0.25 | (uses 2-K) | (3-K/2-K value) |
| 45° elbow, long radius | 500 / 0.15 | 500 / 0.052 / 4.0 | (3-K/2-K value) |
| 45° mitre, 1 weld | 500 / 0.25 | 500 / 0.086 / 4.0 | 15 |
| 45° mitre, 2 welds (22.5°) | 500 / 0.15 | 500 / 0.052 / 4.0 | 6 |
| 180° return, flanged | 1000 / 0.35 | 1000 / 0.12 / 4.0 | 50 |
| 180° return, threaded | 1000 / 0.70 | 1000 / 0.23 / 4.0 | 50 |
| 180° return, long radius | 1000 / 0.30 | 1000 / 0.10 / 4.0 | (3-K/2-K value) |
| Tee run, threaded | 200 / 0.10 | 200 / 0.091 / 4.0 | 20 |
| Tee run, stub-in | 100 / 0.0 | 100 / 0 / 0 | (3-K/2-K value) |
| Tee branch, threaded | 500 / 0.70 | 500 / 0.274 / 4.0 | 60 |
| Tee branch, long radius thr. | 800 / 0.40 | 800 / 0.14 / 4.0 | (3-K/2-K value) |
| Tee branch, stub-in | 1000 / 1.00 | 1000 / 0.34 / 4.0 | (3-K/2-K value) |
| Ball, reduced trim β0.9 | 500 / 0.15 | (uses 2-K) | (3-K/2-K value) |
| Ball/plug, reduced trim β0.8 | 1000 / 0.25 | (uses 2-K) | (3-K/2-K value) |
| Plug, straight through | 300 / 0.10 | 300 / 0.084 / 3.9 | 18 |
| Plug, 3-way through | (uses 3-K) | 300 / 0.14 / 4.0 | 30 |
| Plug, branch flow | (uses 3-K) | 500 / 0.41 / 4.0 | 90 |
| Globe Y-type / angle 45° | 1000 / 2.0 | 950 / 0.25 / 4.0 | 55 |
| Angle valve 90° | 1000 / 2.0 | 1000 / 0.69 / 4.0 | 150 |
| Diaphragm (dam) | 1000 / 2.0 | 1000 / 0.69 / 4.9 | (3-K/2-K value) |
| Lift check | 2000 / 10.0 | 2000 / 2.85 / 3.8 | 600 |
| Tilting-disc check | 1000 / 0.50 | (uses 2-K) | (3-K/2-K value) |
| Entrance, projecting | 160/Re + 1.0 | 160/Re + 1.0 | K 1.0 |
Constants: Hooper (1981) 2-K and Darby (1999) 3-K, transcribed from the textbook reprints (Tables 4-8 and 4-9). [R10] [R11] The 90° elbow in the main list is the standard flanged/welded r/D = 1 elbow and the tees are flanged; other geometries are under "More fittings · valves" in the line properties.
3. Pump head · NPSHa · pressure profile
- Pump fluid: ρ in the head ↔ pressure conversion, static head and NPSHa is the density of the pump suction line (the line just before the pump).
- zs, zd: calculation level of the suction and discharge vessels (default suction LLL, discharge HLL; selectable per vessel). The pump uses its EL (centreline).
- Where line densities differ, each line's friction ΔP is converted to head of the pump fluid before summing: h = ΔP/(ρpump·g).
- Suction strainer: its ΔP is a suction-side loss and counts in both hL,suction (NPSHa) and the head.
- Vapour pressure: "saturated" sets Pv = Ps,abs (suction vessel); "enter value" uses the typed Pv (kgf/cm²a).
- Pressures and power: Ps = Pvessel + ρg(zs − zp − hL,suction), ΔPpump = ρgH, Pd = Ps + ΔPpump. Hydraulic power = ρ·g·Q·max(H, 0), shaft power = hydraulic / η, with Q the design flow of the suction line.
- Pressure profile: the hydraulic grade line HGL = P/ρg + z is followed from the source vessel, and the end pressure at each point is P = (HGL − z)·ρg. The HGL rises by H at the pump.
4. Line pressure chaining line list
- Lines on each pump's governing path: values from the §3 profile. A pump runs at one head, so the line list follows the governing path even when another path is shown on screen.
- Other lines: a line leaving a vessel starts at the vessel operating pressure; a line leaving an inline item starts at the end pressure of the line coming in minus the item ΔP. A line leaving a pump that is not on a calculated path has no start pressure (—).
- End pressure: liquid
P2 = P1 − ΔPfriction − ρ·g·(z2 − z1); vapour and two-phase per §5 and §6. - Branches off the governing path chain on from the junction pressure. Where such a branch arrives above its vessel pressure, the line list shows the excess.
- When the network is not fully solved (missing flow or fluid, path error), pressures carry on as initial values: a pump with no head passes its suction pressure, a line with no calculable loss uses zero friction. These are marked as initial values in the line list.
- Elevations come from the connected items: vessel = calculation level, pump = EL, other items = EL (blank = 0). Inline item ELs can be edited in the line list.
5. Vapour lines calculation model: lineSizingFrictionFactor · solveIsothermalOutletPressure
Properties
Vapour lines use only the vapour fields (Vapor Density, Vapor Viscosity, MW, Z, Cp/Cv). The liquid Density / Viscosity cells are not used, so values left there from before a line was switched to VAPOR do not leak into the calculation.
MW + T take precedence. Without them, a Vapor Density @PT (inlet conditions) is scaled with pressure, ρ(P) = ρinlet · P/P1 (isothermal). The line list marks Temperature, Vapor Density and MW as "Required" until one of these two routes is complete, and Vapor Viscosity until it is entered.
Friction factor (lineSizingFrictionFactor)
Start value: a = ε/(3.7D), b = 5.02/Re, f0 = [ −2·log(a − b·log(a − b·log(a − b·log(a − b·log(a + 14/Re))))) ]−2. This nested explicit approximation belongs to the Shacham (1980) / Zigrang–Sylvester (1982) family and matches the nested a − (5.02/Re)·log(...) structure documented in the Aspen Flare System Analyzer manual (Ch. 9 Theoretical Basis, Eq. 9.5; Eq. 9.5 writes 3 nested levels with −13.0/Re for Fanning ff, whereas the code uses 4 nested levels with +14/Re for Darcy f = 4ff followed by one Colebrook substitution). [R2]
Outlet pressure (solveIsothermalOutletPressure): isothermal compressible flow including acceleration
This integrates the momentum equation dP + G²·d(1/ρ) + f·G²/(2ρD)·ds = 0 over a horizontal straight pipe for a steady, constant-area, isothermal gas with constant Z, so ρ/P and G = ρv are constant. It is 100% identical to Eq. 9.1 of the Aspen Flare System Analyzer manual (Ch. 9, p. 157), (G/a)²·ln(P1/P2) + M(P2² − P1²)/(2RT) + 2ff(L/D)(G/a)² = 0, with f = 4ff (Eq. 9.7) and ρ1 = P1M/(RT). The 2·ln(P1/P2) term is the pressure change from expansion acceleration and is distinct from irreversible friction. f is evaluated once and fittings are treated as an equivalent resistance. The acceleration term is already part of the current implementation. P2 is solved by Newton iteration (relative tolerance 10⁻⁹, max 200). Isothermal and adiabatic models must be kept apart. [R3]
- Choke: F′ = 0 at P2 = √(P1ρ1v1²), the isothermal critical pressure. If F > 0 even there, no subsonic solution exists; the line is flagged choked and the value shows "—". In the calculation model this is the case where the outlet pressure turns negative and the cell goes blank. A Newton step below the critical pressure is bisected back.
- Fittings: f·L/D + ΣK (§2) accounts for pipe and fitting resistance. Equivalent length must not be counted again.
- Elevation: not in solveIsothermalOutletPressure; added as a separate row ΔPg = ρavg·g·Δz, ρavg = (ρ1 + ρ2)/2.
- Mach: c = √(k·P/ρ) (k = Cp/Cv, default 1.3), Ma = v/c shown at inlet and outlet.
- ΔP/100 m: f·(100/D)·ρ1v1²/2 at inlet conditions.
6. Beggs & Brill two-phase pressure loss
Per-line friction method selection
Select Beggs & Brill, Friedel (1979), Müller–Steinhagen–Heck (1986), or Lockhart–Martinelli / Chisholm (1967) in the line list. Selected straight-pipe friction affects the actual pressure profile and pump head. Holdup, gravity and the acceleration denominator remain Beggs & Brill, with a common no-slip fitting K term. Alternative friction forms an application-specific hybrid, not an original full-pressure-loss model. The selection survives saving and reloading. HTFS is not included. Comparison rows show straight-pipe friction only.
MSH: ΔPf = [ΔPlo + 2(ΔPgo−ΔPlo)x](1−x)^(1/3) + ΔPgo x³
LM/Chisholm: ΔPf = ΔPl + C√(ΔPl ΔPg) + ΔPg
lo/go use total flow as each phase alone; l/g use the actual phase flows. LM uses C = 5, 12, 10, or 20 for the liquid/gas laminar–turbulent combinations, with Re = 2000 as the transition and no roughness correction. Friedel requires surface tension, rejects μG > μL, and flags μL/μG > 1000 or downflow. Inclined LM results are flagged as horizontal-model comparisons. MSH and LM remain available without surface tension. Single-phase and zero-flow handling are local extensions.
Equations, coefficients and references: Fluids v1.3.1, MIT. MSH/LM straight-pipe comparisons do not require surface tension, but the full calculation still requires it for Beggs & Brill holdup. An unavailable selected correlation reports an error instead of silently substituting another friction model.
The calculation core is adapted to JavaScript from the MIT-licensed Fluids v1.3.1 implementation, using the revised L1–L4 reference-regime boundaries. Copyright and full MIT notice · Source and local modifications. This is not a direct verification of every equation against the full 1973 paper.
Beggs & Brill (1973) supplies holdup and gravity/acceleration corrections. The per-line friction selection is saved separately; missing or unsupported legacy model IDs default to Beggs & Brill friction. Existing reference results from other methods are historical comparisons, not validation of every hybrid combination.
ρNS = λρL + (1−λ)ρG, μNS = λμL + (1−λ)μG
ρs = HLρL + (1−HL)ρG
ΔPf = (fNS exp(S) L/D + ΣK)ρNS vm²/2
Ek = ρs vm vSG/Pabs
ΔPtotal = (ΔPf + ρs g Δz)/(1−Ek)
The horizontal reference pattern (segregated, transition, intermittent or distributed) determines horizontal liquid holdup. Inclination corrects holdup; it does not predict the actual inclined flow pattern. Transition holdup interpolates the segregated and intermittent branches. Surface tension in dyn/cm is required for two flowing phases. Darcy friction uses the entered roughness; fittings use a no-slip mixture K approximation outside the original straight-pipe correlation.
Fixed inlet properties and constant mass quality are assumed. A differing outlet quality is rejected. Zero-flow calculations use the supplied phase volume fractions without predicting a flowing regime. Holdup outside 0–1, impossible elevation/length geometry, nonpositive outlet absolute pressure and Ek ≥ 1 are rejected. Large pressure changes require subdivision and separate validation. No Payne correction is applied.
Reference: Beggs, H. D., & Brill, J. P., A Study of Two-Phase Flow in Inclined Pipes, JPT 25 (1973), 607–617. Equations cross-checked against Harmony technical documentation; independent numerical comparison: Fluids Beggs_Brill example.
This implementation is not affiliated with or endorsed by the authors or publisher. Results are for preliminary engineering calculations and require independent verification before detailed design.
7. Beggs & Brill reference flow pattern
The calculator reports the horizontal reference regime used by the holdup correlation: segregated, transition, intermittent or distributed. These are grouped regimes, not a prediction of the actual inclined flow pattern. See §6 for the inclination and validity checks.
8. Erosional velocity API RP 14E
Mixture (homogeneous) velocity vm = G/ρm. V/Ve > 1 is shown red; ρv² is shown as well. The code uses 121.99.
9. Verification criteria
Regression agreement is not experimental validation. Check mass conservation, single-phase limits, local pressures, units, original public equations and applicability ranges separately. Private cached examples are not public validation evidence.
10. Assumptions and limits
- Steady state, isothermal within a line. The two-phase vapour fraction is fixed at the input value (flashing enters only through the acceleration term when xout is given).
- Vapour and two-phase results feed the line-list pressures and results. The pump-head path is calculated as liquid.
- The flow pattern uses the horizontal map; vertical and inclined lines need e.g. Taitel–Barnea–Dukler (1980).
- Items with a blank EL are taken at 0. Items with significant elevation need an EL for the pressures to be right.
- Drawing layout and drawn pipe length do not affect the calculation; entered lengths and elevations do.
- Vapour lines ignore the liquid Density/Viscosity cells; enter the vapour properties in their own rows.
11. Variable names and verification
Calculation identifiers name the quantity and units: inletAbsolutePressurePa, outletGaugePressureKgfCm2, liquidDensityKgM3, liquidViscosityCp, liquidViscosityPaS, massFluxKgM2S, gasMassFraction, gasVoidFraction, noSlipLiquidVolumeFraction, frictionPressureLossPa, gravityPressureLossPa, pumpHeadM and availableNpshM. Mass quality, actual void fraction and no-slip fraction are distinct.
Short existing JSON and presentation-field keys remain compatibility contracts; calculation functions unpack them into descriptive identifiers. Regression checks cover flow splits, pressure losses, phase methods, nozzle boundaries, storage and P-310. Regime checks separately cover orientation, equilibrium residual, transitions and consistency between the map and operating point.
12. Sources and confidence
Detailed pressure-loss constants include reference-reproduction choices. Model scope, coefficient provenance and regime verification are distinguished; see §7 for the direct regime references.
Sources checked 2026-10-18. Linked general theory and manual equations are distinguished from detailed polynomial constants whose proprietary original report has not been inspected.
- R1 · Log definitions: JavaScript built-in Math documentation: Math.log10 (base 10), Math.log (natural log). Official definitions confirmed.
- R2 · Friction factor and nested explicit start value: Colebrook (1939), Turbulent flow in pipes, with particular reference to the transition region between the smooth and rough pipe laws; NASA (2014), eq. (4). The nested
ε/(3.7D) − (5.02/Re)·log10(...)initial-guess formula inlineSizingFrictionFactorbelongs to the Shacham (1980) / Zigrang & Sylvester (1982) explicit Colebrook family and matches the nested log structure in the Aspen Flare System Analyzer manual (Ch. 9: Theoretical Basis, p. 159, Eq. 9.5). - R3 · Isothermal compressible pipe flow: Aspen Flare System Analyzer manual (Ch. 9: Theoretical Basis, p. 157, Eq. 9.1),
(G/a)²·ln(P1/P2) + M(P2² − P1²)/(2RT) + 2ff(L/D)(G/a)² = 0, which is 100% identical to the integral solved insolveIsothermalOutletPressure. Supporting: NASA NTRS report 19760005229. - R5 · Efficiency estimate: Carl R. Branan (ed.), Rules of Thumb for Chemical Engineers, 4th ed., Chapter 5: Pumps excerpt. Confirms the GPSA curve basis, units and nature of the fit. The equation image was not text-extractable, so coefficients are given as implemented in this application. The IHS Piper manual has a similar polynomial, but its terms and coefficients are not identical, so it is not used as a basis for copying or replacing.
- R6 · Suction specific speed: KSB pump lexicon, Suction specific speed. NPSH3, BEP, US/SI units and the double-suction basis confirmed. The basis for fixed n = 1750 and Nss = 9000 has not been independently verified against the cited public reference.
- R7 · NPSH margin: Hydraulic Institute, Reliability Basics: Understanding NPSH, POR, and AOR (2022). Confirms the need for margin above NPSH3 and an operating region.
- R8 · Erosional velocity limit: Southwest Research Institute / BSEE, Erosional/Corrosional Testing for Multiphase Flow Lines. Multiphase erosion/corrosion testing and a review of API RP 14E applicability. Not checked against a specific edition of the API standard.
- R9 · Flow pattern: Taitel & Dukler (1976), A model for predicting flow regime transitions in horizontal and near horizontal gas-liquid flow, AIChE J. 22(1), 47–55. Publisher abstract and scope confirmed. A numerical check of every transition boundary in the current code against the paper is not done.
- R10 · 2-K fitting coefficients: W. B. Hooper, “The two-K method predicts head losses in pipe fittings”, Chem. Eng., Aug 24 1981, pp. 96–100. Constants as reprinted in textbook Table 4-8.
- R11 · 3-K fitting coefficients: R. Darby, “Correlate pressure drops through fittings”, Chem. Eng., July 1999, pp. 101–104. Constants and (L/D)eq as reprinted in textbook Table 4-9; not checked against the full original article.
Control valve Cv / Kv / travel
Enable sizing in the valve inspector. Governing REQUIRED inlet pressure and specified device pressure drop remain fixed; sizing never changes hydraulic inputs. Liquid and gas equations, choking, attached reducer corrections and valve Reynolds screening follow public manufacturer references. Low-Re liquid flow requires user-supplied FR. Two-phase flow uses the Flowserve equal-velocity, equivalent-specific-volume approximation for liquid/non-condensable-gas mixtures; flashing or own-vapor applications need manufacturer review. Custom travel/Cv curves are interpolated without extrapolation. Ideal linear/equal-percentage curves are labelled as ideal. Min/normal/design comparisons hold P1 and deltaP fixed; they are not pump operating-point predictions.
Fisher public sizing equations · Masoneilan Reynolds correction · Flowserve two-phase method. See the Korean theory page for equations and units.