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-10-28.
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.
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)
Sb = √((ii·Mi)² + (io·Mo)²) / Z (shared bending term, both rows)
Sa = ia·Fa / Ap (axial term, both rows; Fa defaults to 0, which zeroes Sa; ia = 1.0, the code's own default for elbows/bends/miters)
B31.1 (current editions, 2020–2024 unchanged) SE = √{[|Sa| + Sb]² + (it·Mt / Z)²} vs SA = f·(1.25·Sc + 0.25·Sh) — Figure 104.8-1 Eq. (17)
B31.3 St = Mt / (2·Z), SE = √((|Sa| + Sb)² + (2·St)²) vs SA (same form as B31.1) — ¶319.4.4 Eq. (17)
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. Both rows now run their code's current-edition Eq. (17): B31.1's has read this direction-split form since the 2020 edition (unchanged through 2024, which additionally deleted Mandatory Appendix D but left the equation itself alone); the single-i-on-resultant-moment form this card used to implement for B31.1 is the 2018-and-earlier form, not a current one. In the current editions the two expansion equations are the same expression written two ways: B31.3-2024 ¶319.4.4 defines St = it·Mt/2Z and squares 2St, while B31.1-2024 Figure 104.8-1 squares it·Mt/Z directly, and both add the axial term to the bending term before squaring. With the same inputs the two expansion rows therefore return the same SE; the rows differ in the allowables and sustained stress the user enters for each code, which is where the comparison earns its place. Defaults when not entered: f = 1.0, F = 0.72, E = 1.0, T = 1.0, it = 1.0, Fa = 0.
| Inputs | ||
|---|---|---|
| codes | Codes to include in the comparison — any subset of B31.1, B31.3, B31.4, B31.8 | — |
| P | Internal design pressure | psi |
| Do | Pipe outside diameter | in |
| t | Wall thickness | in |
| Z | Section modulus | in³ |
| Mi, Mo, Mt | In-plane, out-plane and torsional moment ranges | in·lbf |
| ii, io | In-plane and out-plane stress intensification factors | — |
| it | Torsional stress intensification factor — both rows (default 1.0) | — |
| Fa, Ap | Axial force range and pipe metal area — optional axial term for both rows (Fa default 0; Ap required only if Fa is nonzero) | lbf, in² |
| Sc, Sh | Cold and hot allowable stress — required if B31.1 or B31.3 is selected | psi |
| SL | Sustained longitudinal stress from the weight + pressure case | psi |
| SMYS | Specified minimum yield strength — required if B31.4 or B31.8 is selected | psi |
| fRange, designFactor, eJoint, tempDerating | Stress-range factor f, pipeline design factor F, joint factor E, temperature derating T (defaults 1.0, 0.72, 1.0, 1.0) | — |
| Outputs | ||
| rows | One row per code check: quantity, stress, allowable, unity | — |
| governingUnity | Highest unity across the whole set | — |
| governing | Code + quantity label of the governing row | — |
| verdict | ALL PASS or SOME EXCEED | — |
Limitations — what this calculator is not
- Screening comparison only — each code's full analysis carries provisions (restraint condition, occasional loads, casing/riser rules, code-year differences) this table does not evaluate. Confirm the governing result with a complete analysis before using it to close out a design.
- No allowable stress table is embedded — Sc, Sh and SMYS are entered by you from the applicable material specification and code edition; an incorrect allowable produces an incorrect unity on every row that uses it.
- B31.4 and B31.8 unities apply SMYS directly with a user-entered design/location-class factor F. Establishing the correct location class or fluid-service factor from the governing edition is the engineer's responsibility — the code selector changes no arithmetic on its own.
- The B31.8 'combined' row pairs sustained SL with the B31.1-form expansion stress (Figure 104.8-1 Eq. (17)) as a screening proxy; it is not a substitute for B31.8's own combined-stress and design equations in full.
- Sustained-case moments are not separately entered for B31.1/B31.3 — SL is a single user-supplied sustained longitudinal stress, so the tool does not recompute sustained stress from Mi/Mo/Mt; only the expansion-case resultant uses those moments.
- The axial-force SIF ia is not a user input — this screening card has no component-type selector, so it applies the code's own default (ia = 1.0, elbows/pipe bends/miter bends) whenever Fa is entered nonzero. For a reduced outlet, welding tee or other component where ia differs, run a full analysis instead of this screen.
- The B31.1 expansion row implements Figure 104.8-1 Eq. (17) as it has read since the 2020 edition (2020, 2022 and 2024 are identical here — 2024 only deleted Mandatory Appendix D, which this row never used). On a job governed by B31.1-2018 or earlier, this row overstates the code's own equation, which used a single i on the resultant moment instead — run a full analysis for that edition rather than this screen.
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 × Z | 8.625 × 0.322 × 16.81 | in / in / in³ |
| Pressure P | 600 | psi |
| Mi / Mo / Mt | 50,000 / 30,000 / 20,000 | in·lbf |
| ii / io | 2.27 / 1.89 | — |
| Sc / Sh | 20,000 / 17,300 | psi |
| SL | 8,000 | psi |
| SMYS | 35,000 | psi |
Step by step
- 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.
- Shared bending term: Sb = √((2.27·50,000)² + (1.89·30,000)²)/16.81 = √(113,500² + 56,700²)/16.81 = 7,547.56 psi — used by both the B31.1 and B31.3 rows. Axial term Sa = ia·Fa/Ap = 0 (Fa not entered here — see Example 3 for a case with Fa ≠ 0).
- B31.1 expansion stress (Figure 104.8-1 Eq. (17), current since the 2020 edition): SE = √{[|Sa| + Sb]² + (it·Mt/Z)²} = √{7,547.56² + (1.0·20,000/16.81)²} = √{7,547.56² + 1,189.77²} = 7,640.76 psi (it = 1.0 default).
- 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.
- B31.1: sustained unity = SL/Sh = 8,000/17,300 = 0.46243; expansion unity = SE/SA = 7,640.76/29,325 = 0.26055.
- B31.3 expansion stress (¶319.4.4 Eq. (17)): St = 20,000/(2·16.81) = 594.88 psi; SE = √((Sa + Sb)² + (2·St)²) = √(7,547.56² + 1,189.77²) = 7,640.76 psi — identical to the B31.1 value here, because B31.3's 2·St reduces to the same Mt/Z that B31.1's it·Mt/Z gives at the default it = 1.0.
- B31.3: sustained unity matches B31.1 at 0.46243 (same SL/Sh); expansion unity = 7,640.76/29,325 = 0.26055.
- 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.
- 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 + 7,640.76)/31,500 = 15,640.76/31,500 = 0.49653.
- Governing row across all eight checks: B31.8 combined at 0.49653 — the highest unity in the set, still ≤ 1.0 → ALL PASS.
| Result PASS | ||
|---|---|---|
| B31.1 sustained / expansion | 0.46243 / 0.26055 | unity |
| B31.3 sustained / expansion | 0.46243 / 0.26055 | unity |
| B31.4 hoop / longitudinal | 0.31888 / 0.42328 | unity |
| B31.8 hoop / combined | 0.31888 / 0.49653 | unity |
| Governing check (code / quantity) | gas-pipeline combined row | — |
| Governing unity | 0.49653 | — |
| Verdict | ALL 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. Note that the B31.1 and B31.3 expansion unities come out identical (both 0.26055): in the current editions the two Eq. (17) forms are the same expression, so identical moments, SIFs and allowables give identical expansion rows — Example 3 below shows the axial term and a torsional SIF moving both rows together. The pipeline-only example below shows the same geometry at higher pressure, where B31.4 hoop alone flips the verdict.
analysis-set.json — case “NPS8 sch40 all four codes, moderate loads -> governing B31.8 combined 0.49653, 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 × Z | 8.625 × 0.322 × 16.81 | in / in / in³ |
| Pressure P | 2,200 | psi |
| SMYS | 35,000 | psi |
| SL | 8,000 | psi |
Step by step
- Hoop stress: hoop = P·Do/(2·t) = 2,200·8.625/0.644 = 18,975/0.644 = 29,464.29 psi.
- B31.4 hoop allowable: F·SMYS = 0.72·35,000 = 25,200 psi. Unity = 29,464.29/25,200 = 1.16922.
- 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 unity | 1.16922 | — |
| Verdict | SOME 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.
Worked example 3 — axial force and a torsional SIF in both expansion rows
Same NPS 8 Sch 40 geometry, moments and SIFs as Example 1, screened against B31.1 and B31.3 only, with an axial force range Fa = 15,000 lbf, pipe metal area Ap = 8.4 in², and a torsional SIF it = 1.5 instead of the 1.0 default.
| Given | ||
|---|---|---|
| Do × t × Z | 8.625 × 0.322 × 16.81 | in / in / in³ |
| Mi / Mo / Mt | 50,000 / 30,000 / 20,000 | in·lbf |
| ii / io / it | 2.27 / 1.89 / 1.5 | — |
| Fa / Ap | 15,000 / 8.4 | lbf / in² |
| Sc / Sh | 20,000 / 17,300 | psi |
| SL | 8,000 | psi |
Step by step
- Axial term (both rows): Sa = ia·Fa/Ap = 1.0·15,000/8.4 = 1,785.71 psi.
- Shared bending term (unchanged from Example 1): Sb = 7,547.56 psi. |Sa| + Sb = 1,785.71 + 7,547.56 = 9,333.27 psi.
- B31.1 expansion stress: SE = √{9,333.27² + (1.5·20,000/16.81)²} = √{9,333.27² + 1,784.65²} = 9,502.37 psi; unity = 9,502.37/29,325 = 0.32404.
- B31.3 expansion stress: St = it·Mt/2Z = 1.5·20,000/33.62 = 892.33 psi; SE = √{9,333.27² + (2·892.33)²} = √{9,333.27² + 1,784.65²} = 9,502.37 psi; unity = 9,502.37/29,325 = 0.32404 — the same number as the B31.1 row, because the two current-edition forms are the same expression.
- Sustained unities are unchanged at 0.46243 each (SL/Sh has no Fa/it dependence) — still the governing row. Governing: B31.1 sustained SL at 0.46243 → ALL PASS.
| Result PASS | ||
|---|---|---|
| B31.1 expansion | 0.32404 | unity |
| B31.3 expansion | 0.32404 | unity |
| Governing check (code / quantity) | power-piping sustained row | — |
| Governing unity | 0.46243 | — |
| Verdict | ALL PASS | — |
With the axial term and a torsional SIF of 1.5, both expansion rows rise together to 0.32404 — the axial stress adds to the bending stress before squaring, and the torsional SIF scales the torsion term the same way in both books. Neither expansion unity overtakes the sustained row here, so the governing check stays on the sustained side in this example.
Fixture case “B31.1/B31.3 only with axial force + torsional SIF (Fa=15000 lbf, Ap=8.4 in^2, it=1.5) -> B31.1 sustained governs 0.46243, ALL PASS” (tolerance 0.001) — locked in the same release gate as the example above.
Sources & citations
- ASME B31.1 — Power Piping, ¶104.8.1 (sustained) and Figure 104.8-1 Eq. (17) (expansion, current since the 2020 edition).
- ASME B31.3 — Process Piping, ¶302.3.5 (sustained) and ¶319.4.4 Eq. (17) (expansion).
- ASME B31.4 — Pipeline Transportation Systems for Liquids and Slurries, Design chapter.
- ASME B31.8 — Gas Transmission and Distribution Piping Systems, Design chapter.
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. On the expansion side the current editions agree: B31.3-2024 ¶319.4.4 defines St = it·Mt/2Z and squares 2St, B31.1-2024 Figure 104.8-1 squares it·Mt/Z, and both add the axial term Sa to the bending term before squaring — one expression written two ways, so the same moments and SIFs give the same SE, as Examples 1 and 3 show. The pre-2020 B31.1 single-i resultant form did differ, which is why older comparisons show a gap. What still separates the rows is what the analyst enters per code: the allowables Sc and Sh, the stress range factor f and the sustained stress SL each come from that code's own tables and rules, and seeing those 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 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. That independence keeps the table quick to read, but it also bounds the conclusion: a line passing all four codes has passed four separate sufficiency screens, not one unified analysis. Example 1 above shows why the distinction matters: B31.4 hoop and B31.8 hoop both land on 0.31888 unity from the identical P·Do/(2·t) stress, checked against allowables that happen to coincide once B31.8's joint and temperature-derating factors default to 1.0. Two codes agreeing to five decimal places looks like cross-validation; it is one formula evaluated twice against allowables that reduce to the same number under these defaults, and it says nothing about the combined or expansion rows. 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 own check set to finish the qualification.
Related calculators & tools
- Displacement Stress Range Check (ASME B31.3 ¶319.4.4) — The single-code B31.3 expansion check behind the comparison row
- ASME B31.4 / B31.8 / B31.11 Pipeline Wall Thickness Calculator — Wall thickness for the pipeline codes in the same set
- Piping Criticality Evaluation Calculator (API 580/581 Screening Rubric) — Roll the governing unity into a line criticality class
- B31.1 stress intensification factors — FAQ — How B31.1-2024 applies the B31J factors inside its own stress equations