Piping Toolset
HomeCalculators › Analysis Sets: Multi-Code Piping Stress Comparison Calculator

Analysis Sets: Multi-Code Piping Stress Comparison Calculator

Runs one load case through up to four piping codes side by side — sustained and expansion stress against allowable for B31.1 and B31.3, hoop and longitudinal/combined against SMYS-based allowables for B31.4 and B31.8 — and reports every row's unity plus the single governing check in one table.

Method last updated (calculation changelog) · fixture-verified on every build — most recently 2026-09-14.

Built and fixture-verified by Matthew Norris, P.E. — active P.E. licensure in Arizona, California, Kansas, Missouri, North Carolina, Texas.

Takes one geometry (outside diameter, wall, section modulus) and one load case (pressure, moment ranges, SIFs) and runs it through the sustained and expansion screening checks of ASME B31.1 and B31.3, and the hoop and longitudinal/combined checks of the pipeline codes B31.4 and B31.8 — the per-code 'analysis set' concept, in one comparison table. Every allowable stress (Sc, Sh, SMYS) and every factor (stress-range factor f, design factor F, joint factor E, temperature derating T) is a user-supplied input; nothing is looked up from an internal code table. The output is a row per code check with stress, allowable and unity, the governing row across the whole set, and an overall ALL PASS / SOME EXCEED verdict.

One load case checked against four B31 codes Four horizontal bars labeled B31.1, B31.3, B31.4 and B31.8 showing each code's governing unity check approaching a dashed allowable line at 1.0, with the governing code marked in red. 1.0 — allowable B31.1 B31.3 governing — closest to its allowable B31.4 B31.8 same P, D, weight and thermal moments into every code
One load case, four code checks: the same pressure, weight and thermal moments run through the B31.1, B31.3, B31.4 and B31.8 stress equations — each bar is that code's governing unity against the allowable, with the controlling code called out.
Open the batch runner → Download sample report
Where this calculation now lives. The Analysis Sets card was retired from the General line on 2026-08-19. Run the same comparison through the batch runner, or take each code on its own line — B31.3, B31.1 and B31.4 / B31.8 — where each check carries its own inputs and citations. The method, the worked example below and the underlying module are unchanged — the module is still locked by its fixture on every build.

Method

Same geometry and load case evaluated by each selected code's own screening check, with allowables entered by the user rather than embedded:

hoop = P·Do / (2·t)

Mc = √(Mi² + Mo² + Mt²), imax = max(ii, io)

B31.1 (2016-and-earlier resultant form) SE = imax·Mc / Z vs SA = f·(1.25·Sc + 0.25·Sh)

B31.3 Sb = √((ii·Mi)² + (io·Mo)²) / Z, St = Mt / (2·Z), SE = √(Sb² + 4·St²) vs SA (same form as B31.1)

B31.4 hoop vs F·SMYS; longitudinal SL vs 0.75·F·SMYS

B31.8 hoop vs F·E·T·SMYS; combined (SL + SEB31.1) vs 0.90·T·SMYS

B31.1 and B31.3 sustained rows both compare the same user-supplied sustained longitudinal stress SL against the hot allowable Sh — the two rows diverge only in how they combine the expansion-case moments into SE. The B31.1 row implements the resultant-moment expansion equation of the 2016 and earlier editions, in which a single i acts on the resultant of all three moments; ASME B31.1-2024 Figure 104.8-1 eq. (17) now separates the in-plane, out-of-plane and torsional terms with their own B31J factors, structurally like the B31.3 row, so for a 2024 power-piping job treat the B31.1 row as a legacy-edition screen and the B31.3 row as the closer structural proxy. Defaults when not entered: f = 1.0, F = 0.72, E = 1.0, T = 1.0.

Inputs
codesCodes to include in the comparison — any subset of B31.1, B31.3, B31.4, B31.8
PInternal design pressurepsi
DoPipe outside diameterin
tWall thicknessin
ZSection modulusin³
Mi, Mo, MtIn-plane, out-plane and torsional moment rangesin·lbf
ii, ioIn-plane and out-plane stress intensification factors
Sc, ShCold and hot allowable stress — required if B31.1 or B31.3 is selectedpsi
SLSustained longitudinal stress from the weight + pressure casepsi
SMYSSpecified minimum yield strength — required if B31.4 or B31.8 is selectedpsi
fRange, designFactor, eJoint, tempDeratingStress-range factor f, pipeline design factor F, joint factor E, temperature derating T (defaults 1.0, 0.72, 1.0, 1.0)
Outputs
rowsOne row per code check: quantity, stress, allowable, unity
governingUnityHighest unity across the whole set
governingCode + quantity label of the governing row
verdictALL PASS or SOME EXCEED

Limitations — what this calculator is not

Worked example — fixture-verified

NPS 8 Sch 40 line (8.625 in OD × 0.322 in wall, Z = 16.81 in³) carrying 600 psi, evaluated against all four codes at once. Moment range resultants of 50,000 / 30,000 / 20,000 in·lbf (in-plane / out-plane / torsional) with SIFs ii = 2.27, io = 1.89; Sc = 20,000 psi, Sh = 17,300 psi; SL = 8,000 psi; SMYS = 35,000 psi with the default design factor F = 0.72.

Given
Do × t × Z8.625 × 0.322 × 16.81in / in / in³
Pressure P600psi
Mi / Mo / Mt50,000 / 30,000 / 20,000in·lbf
ii / io2.27 / 1.89
Sc / Sh20,000 / 17,300psi
SL8,000psi
SMYS35,000psi

Step by step

  1. Hoop stress: hoop = P·Do/(2·t) = 600·8.625/(2·0.322) = 5,175/0.644 = 8,035.71 psi — feeds both the B31.4 and B31.8 hoop checks.
  2. Resultant moment: Mc = √(50,000² + 30,000² + 20,000²) = √3,800,000,000 = 61,644.14 in·lbf.
  3. B31.1 expansion stress: imax = max(2.27, 1.89) = 2.27; SE = 2.27·61,644.14/16.81 = 8,324.34 psi.
  4. B31.1/B31.3 allowable: SA = f·(1.25·Sc + 0.25·Sh) = 1.0·(1.25·20,000 + 0.25·17,300) = 25,000 + 4,325 = 29,325 psi.
  5. B31.1: sustained unity = SL/Sh = 8,000/17,300 = 0.46243; expansion unity = SE/SA = 8,324.34/29,325 = 0.28387.
  6. B31.3 expansion stress: Sb = √((2.27·50,000)² + (1.89·30,000)²)/16.81 = √(113,500² + 56,700²)/16.81 = 7,547.56 psi; St = 20,000/(2·16.81) = 594.88 psi; SE = √(Sb² + 4·St²) = 7,640.76 psi.
  7. B31.3: sustained unity matches B31.1 at 0.46243 (same SL/Sh); expansion unity = 7,640.76/29,325 = 0.26055.
  8. B31.4: hoop unity = 8,035.71/(0.72·35,000) = 8,035.71/25,200 = 0.31888; longitudinal unity = SL/(0.75·0.72·35,000) = 8,000/18,900 = 0.42328.
  9. B31.8: hoop unity = 8,035.71/(0.72·1.0·1.0·35,000) = 0.31888 (E = T = 1.0 default); combined unity = (SL + SEB31.1)/(0.9·1.0·35,000) = (8,000 + 8,324.34)/31,500 = 16,324.34/31,500 = 0.51823.
  10. Governing row across all eight checks: B31.8 combined at 0.51823 — the highest unity in the set, still ≤ 1.0 → ALL PASS.
Result PASS
B31.1 sustained / expansion0.46243 / 0.28387unity
B31.3 sustained / expansion0.46243 / 0.26055unity
B31.4 hoop / longitudinal0.31888 / 0.42328unity
B31.8 hoop / combined0.31888 / 0.51823unity
Governing check (code / quantity)gas-pipeline combined row
Governing unity0.51823
VerdictALL PASS

B31.8's combined check governs here even though both pipeline hoop unities tie with B31.4's — the sustained-plus-expansion sum on the combined row is what pushes it above every other check in the set. The pipeline-only example below shows the same geometry at higher pressure, where B31.4 hoop alone flips the verdict.

Why you can trust these numbers: this exact case is fixture analysis-set.json — case “NPS8 sch40 all four codes, moderate loads -> governing B31.8 combined 0.518, ALL PASS” (tolerance 0.001) — in the calc-core release gate. It re-runs on every commit; a red fixture blocks deployment. See the validation methodology.

Worked example 2 — pipeline codes only, higher pressure fails hoop

Same NPS 8 Sch 40 geometry, moments and SIFs, screened as a pipeline (B31.4 and B31.8 only, Sc/Sh omitted since neither pipeline code needs them) at 2,200 psi instead of 600 psi.

Given
Do × t × Z8.625 × 0.322 × 16.81in / in / in³
Pressure P2,200psi
SMYS35,000psi
SL8,000psi

Step by step

  1. Hoop stress: hoop = P·Do/(2·t) = 2,200·8.625/0.644 = 18,975/0.644 = 29,464.29 psi.
  2. B31.4 hoop allowable: F·SMYS = 0.72·35,000 = 25,200 psi. Unity = 29,464.29/25,200 = 1.16922.
  3. 1.16922 > 1.0 — this row alone drives the set to SOME EXCEED, regardless of how the remaining B31.8 rows land.
Result FAIL
B31.4 hoop unity1.16922
VerdictSOME EXCEED

Same wall and geometry as Example 1 — only the pressure and the code subset changed, and hoop stress alone (not the more elaborate expansion or combined checks) is what fails the line. That's a useful diagnostic: when a pipeline unity fails on hoop specifically, the fix is thicker wall or lower MAOP, not a restraint or SIF revisit.

Fixture case “pipeline codes only at P=2200 -> hoop 29464.29 vs 25200, unity 1.16922 SOME EXCEED” (tolerance 0.001) — locked in the same release gate as the example above.

Sources & citations

Per the source & citation policy, allowable-stress and factor table values are inputs — typed from your governing edition, or autofilled on paid tiers from the embedded datasets enumerated there, always cited by standard, edition, table and line. Where a page does reproduce specific ASME data (the B16.5 ratings, the quick-reference tables), it states the source table and conditions inline.

FAQ

Why do B31.1 and B31.3 report the same sustained unity?

Both codes compare the same user-supplied sustained longitudinal stress SL against the hot allowable Sh — SL/Sh only differs between the two once the analyst enters a different SL for each code. They diverge on the expansion-stress combination rule: the B31.1 row uses the single resultant-moment SIF term of the 2016-and-earlier B31.1 editions, B31.3 splits bending and torsion before combining — and B31.1-2024 Figure 104.8-1 eq. (17) has since moved to the split form as well, with its own B31J in-plane, out-of-plane and torsional factors. The expansion-side divergence is the one to internalize: on a torsion-heavy load set, the legacy resultant-moment treatment and the split handling can return visibly different expansion stresses from identical inputs — same pipe, same moments, different equation generations, different unity. That is not an error in either; it is the combination rules differing by code and by edition, and seeing it side by side in one table is precisely what this card is for. When the two diverge on a real line, the governing book is the contract's, and the comparison documents why the other number was not used.

Can I mix process-piping codes and pipeline codes in one comparison?

Yes — select any subset of the four; the tool only requires the inputs the selected codes need (Sc/Sh for B31.1/B31.3, SMYS for B31.4/B31.8). Running all four on the same geometry is useful for a line that transitions from plant piping into a pipeline tie-in and needs both allowable bases checked side by side. The tie-in case rewards one more discipline: establish where the code break physically sits — the standard answer is a defined station boundary or the first flange/valve per the contract documents — and assign each side's checks to its own book rather than enveloping both with the stricter result. Enveloping feels conservative but muddles the record: each code's allowable basis is self-consistent, and the audit question is always 'which code governs this weld,' not 'did some code somewhere pass it.' The side-by-side table answers the first question cleanly.

Is the governing unity a combined interaction check?

No — governing unity is simply the maximum of the independent per-code unities in the table, not a combined interaction ratio. Each code's check stands alone against its own allowable; nothing here sums stresses across codes. The independence is what makes the table safe to read quickly, but it also bounds what the card can conclude: a line passing all four codes has passed four separate sufficiency screens, not one unified analysis — and effects that live between the checks, like a pipeline code's restrained-line longitudinal case versus a process code's displacement range, remain each book's own business. Use the governing unity to find the binding code fast; use that code's full check set, not this summary, to finish the qualification.

Related calculators

Open the batch runner → All calculators