@theerapat-s28/ts-structural-eng-tools/rc
RC Beam Design
Flexural capacity and reinforcement layout of rectangular reinforced-concrete beam sections per ACI 318-19.
The rc module computes the design moment capacity φMn of rectangular
RC beam sections — singly or doubly reinforced — the design shear capacity contributions
φVc / φVs and whether stirrups are required, and lays out rebar
groups into layers that satisfy ACI 318-19 spacing rules. Material helpers cover the β₁
stress-block factor, the concrete elastic modulus, and psi→MPa conversion.
unit field.
warnings array, each citing the exact ACI clause. Broken calculation assumptions throw an RCDesignError instead — a result is never silently returned when its assumptions failed.
count and diameter (mm).The two main functions are designed to chain: the bar layout produces the effective depths that the capacity calculation consumes.
Call
rectBeamBarLayout with the section size and the top/bottom bar groups.
It arranges the bars into the minimum number of layers that satisfy ACI 318-19 spacing rules
and returns d, d_, and the steel areas.
Feed
d, d_, and the areas into rectBeamMomentCapacity
together with the material properties to get φMn in kN·m.
Check the merged
warnings array for code-provision notes
(e.g. minimum steel per ACI318-19, 9.6.1.2) before accepting the design.
rc-beam-design.ts
Calculates the design moment capacity φMn of a rectangular RC beam section.
The reinforcement configuration is detected automatically: passing As_ and
d_ greater than zero switches the analysis to a doubly reinforced section
(compression steel assumed elastic, solved via the quadratic equilibrium equation);
otherwise the section is treated as singly reinforced.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| Es | number | MPa | Required | Elastic modulus of reinforcing steel (typically 200,000) |
| fc_ | number | MPa | Required | Specified compressive strength of concrete f′c |
| fy | number | MPa | Required | Yield strength of reinforcing steel |
| As | number | mm² | Required | Area of tension reinforcement |
| b | number | mm | Required | Section width |
| h | number | mm | Required | Overall section height |
| d | number | mm | Required | Effective depth to the tension steel centroid |
| As_ | number | mm² | Optional | Area of compression reinforcement (doubly reinforced only) |
| d_ | number | mm | Optional | Depth to the compression steel centroid from the compression face |
import { rectBeamMomentCapacity } from '@theerapat-s28/ts-structural-eng-tools/rc'; const result = rectBeamMomentCapacity({ Es: 200000, // MPa fc_: 28, // MPa fy: 390, // MPa As: 1472.6, // mm² (3-DB25) b: 300, // mm h: 500, // mm d: 440, // mm });
{
phiMn: 206.64, // φ = 0.9 applied, rounded to 2 dp
calculationDetails: {
c: 94.63, // mm, neutral-axis depth
a: 80.44, // mm, equivalent stress-block depth
beta1: 0.85,
d: 440, // mm, as supplied
As: 1472.6, // mm², as supplied
ro: 0.011156 // reinforcement ratio As / (b·d)
},
unit: 'kN-m',
warnings: []
}
Every key above is returned for both singly and doubly reinforced sections, so callers
need not branch on the section type. A doubly reinforced section adds
d_, As_, the compression-steel stress fs_, and the
compression ratio ro_ = A′s / (b·d) — the same basis as
ro, so the two are directly comparable.
As is below the minimum reinforcement max(0.25√f′c·b·d/fy, 1.4·b·d/fy) — ACI318-19, 9.6.1.2.
fy exceeds 550 MPa — ACI318-19, 9.6.1.2.
d_ exceeds the neutral-axis depth c — ACI318-19, 22.2.1.2. The compression steel then lies below the neutral axis and acts in tension; fs_ is returned negative and Mn accounts for it. This is a valid section, not an error.
fs_ reaches fy in either direction, equilibrium is re-solved with that steel at yield and fs_ is capped at ±fy — ACI318-19, 20.2.2.1.
rc-beam-design.ts
Three functions cover ACI 318-19 shear design for rectangular sections without significant
axial load: concreteShearCapacity for the concrete contribution φVc,
stirrupShearCapacity for the stirrup contribution φVs, and
checkStirrupRequirement to determine whether stirrups are required at all,
and if so, whether the code minimum suffices or strength-based reinforcement is needed.
Calculates the concrete contribution to shear capacity φVc per
ACI318-19, 22.5.5.1, Table 22.5.5.1(a):
Vc = 0.17·λ·√f′c·bw·d.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| fc_ | number | MPa | Required | Specified compressive strength of concrete f′c |
| bw | number | mm | Required | Web width |
| d | number | mm | Required | Effective depth to the tension steel centroid |
| lambda | number | — | Optional | Concrete density modification factor (default 1.0, normal weight) |
import { concreteShearCapacity } from '@theerapat-s28/ts-structural-eng-tools/rc'; const result = concreteShearCapacity({ fc_: 25, // MPa bw: 250, // mm d: 450, // mm });
{
phiVc: 71.72, // φ = 0.75 applied, rounded to 2 dp
calculationDetails: {
Vc: 95.63, // kN, unreduced
lambda: 1
},
unit: 'kN',
warnings: []
}
√f′c at 8.3 MPa when it exceeds that limit, unless minimum shear reinforcement per ACI318-19, 9.6.3.3 is provided elsewhere in the design — ACI318-19, 22.5.3.1.
Calculates the stirrup contribution to shear capacity φVs per
ACI318-19, 22.5.10.5.3: Vs = Av·fyt·d / s.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| fc_ | number | MPa | Required | Specified compressive strength of concrete f′c |
| bw | number | mm | Required | Web width |
| d | number | mm | Required | Effective depth to the tension steel centroid |
| Av | number | mm² | Required | Area of shear reinforcement within spacing s (both legs) |
| fyt | number | MPa | Required | Yield strength of the stirrup steel |
| s | number | mm | Required | Stirrup spacing |
import { stirrupShearCapacity } from '@theerapat-s28/ts-structural-eng-tools/rc'; const result = stirrupShearCapacity({ fc_: 25, // MPa bw: 250, // mm d: 450, // mm Av: 157, // mm², 2-legged DB10 stirrup fyt: 240, // MPa s: 150, // mm });
{
phiVs: 84.78, // φ = 0.75 applied, rounded to 2 dp
calculationDetails: {
Vs: 113.04, // kN, unreduced
maxVs: 371.25 // kN, ACI318-19 22.5.1.2 ceiling
},
unit: 'kN',
warnings: []
}
Vs exceeds 0.66·√f′c·bw·d — ACI318-19, 22.5.1.2. The section is too small for shear; increase bw or d.
Determines whether shear reinforcement is required at a section, and whether the code
minimum suffices or strength-based design is needed, per ACI318-19, 9.6.3.1
(requirement thresholds), 9.6.3.3 (Av,min), and 9.7.6.2.2
(max spacing). If Av and s are supplied, the provided
reinforcement is checked against the required ratio and spacing, adding warnings on
any shortfall.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| fc_ | number | MPa | Required | Specified compressive strength of concrete f′c |
| bw | number | mm | Required | Web width |
| d | number | mm | Required | Effective depth to the tension steel centroid |
| Vu | number | kN | Required | Factored shear force at the section |
| fyt | number | MPa | Required | Yield strength of the stirrup steel |
| Av | number | mm² | Optional | Provided area of shear reinforcement within spacing s (both legs) |
| s | number | mm | Optional | Provided stirrup spacing |
| lambda | number | — | Optional | Concrete density modification factor (default 1.0, normal weight) |
import { checkStirrupRequirement } from '@theerapat-s28/ts-structural-eng-tools/rc'; const result = checkStirrupRequirement({ fc_: 25, // MPa bw: 250, // mm d: 450, // mm fyt: 240, // MPa Vu: 150, // kN });
{
required: true,
minimumOnly: false, // Vu > phiVc, strength-based design required
calculationDetails: {
phiVc: 71.72, // kN
halfPhiVc: 35.86, // kN
requiredAvOverS: 0.9664, // mm²/mm, max of strength- and minimum-based ratio
maxSpacing: 225 // mm
},
unit: 'kN',
warnings: []
}
When Vu ≤ 0.5·φVc, required is false and no
stirrups are needed. When 0.5·φVc < Vu ≤ φVc, minimumOnly
is true and requiredAvOverS reflects only the ACI318-19
9.6.3.3 minimum. Otherwise strength-based reinforcement is required and
requiredAvOverS is the larger of the minimum and strength ratios.
Av / s is below the required ratio.
s exceeds the computed maximum spacing.
Vs exceeds 0.66·√f′c·bw·d — the section is too small for the demand even with maximum stirrups.
rc-bar-layout.ts
Lays out top and bottom rebar groups within a rectangular section, splitting each group
into the minimum number of layers that satisfies ACI 318-19 minimum clear spacing within
a layer (25.2.1) and between layers (25.2.2). Returns the effective depth d
and compression-steel depth d_, both measured from the top (compression)
face so they plug directly into rectBeamMomentCapacity.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| b | number | mm | Required | Section width |
| h | number | mm | Required | Overall section height |
| topBars | RebarGroupInput | — | Optional | Top (compression) bar group: count, diameter (mm). Omit it for a section with no top reinforcement — d_ is then 0. |
| bottomBars | RebarGroupInput | — | Required | Bottom (tension) bar group: count, diameter (mm) |
| cover | number | mm | Optional | Clear cover to the stirrup (default 40) |
| stirrupDiameter | number | mm | Optional | Stirrup bar diameter (default 10) |
| maxAggregateSize | number | mm | Optional | Nominal maximum aggregate size (default 20) |
import { rectBeamBarLayout } from '@theerapat-s28/ts-structural-eng-tools/rc'; const layout = rectBeamBarLayout({ b: 300, // mm h: 500, // mm topBars: { count: 2, diameter: 16 }, // 2-DB16 — omit for no top bars bottomBars: { count: 5, diameter: 25 }, // 5-DB25 });
{
d: 417.5, // mm, effective depth to bottom-group centroid
d_: 58, // mm, depth to top-group centroid
top: {
numberOfLayers: 1,
barsPerLayer: [2],
As: 402.1 // mm²
},
bottom: {
numberOfLayers: 2,
barsPerLayer: [3, 2], // 5 bars don't fit in one layer of b = 300
As: 2454.4 // mm²
},
unit: 'mm',
warnings: []
}
cover (40 mm), stirrupDiameter (10 mm), and maxAggregateSize (20 mm) follow ACI318-19, Table 20.6.1.3.1 for cast-in-place beams not exposed to weather or in contact with ground.
h.
general.tsReturns the ACI 318 β₁ factor for the equivalent rectangular stress block: 0.85 for f′c ≤ 28 MPa, reducing by 0.05 per 7 MPa above 28, clamped at 0.65.
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| fc_ | number | MPa | Required | Concrete compressive strength f′c |
concreteBeta(28); // → 0.85 concreteBeta(42); // → 0.75
Estimates the modulus of elasticity of normal-weight concrete per ACI 318:
Ec = 4700·√f′c (MPa).
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| fc_ | number | MPa | Required | Concrete compressive strength f′c |
concreteElasticModulus(28); // → 24870.06 MPa
Converts a pressure value from psi to MPa (divides by 145.038).
| Param | Type | Unit | Required? | Description |
|---|---|---|---|---|
| psi | number | psi | Required | Pressure in pounds per square inch |
psiToMpa(4000); // → 27.58 MPa
Thrown errors are instances of RCDesignError (exported from
@theerapat-s28/ts-structural-eng-tools/core) with a numeric
code. Codes in the 1XX range belong to RC beam design.
| Code | Name | Thrown by | Meaning |
|---|---|---|---|
| 101 | COMP_STEEL_DISTANCE_OVER_AC | no longer thrown | Retired in 1.4.0. d′ beyond the neutral axis is now handled by strain compatibility and reported as a warning. The entry remains exported so existing code === 101 checks keep compiling. |
| 102 | TENSILE_STEEL_NOT_YIELDING | rectBeamMomentCapacity | Out of the tension-controlled region — εt < εty + 0.003 (ACI318-19, Table 21.2.2), so φ = 0.9 does not apply. |
| 103 | SECTION_TOO_NARROW_FOR_BAR | rectBeamBarLayout | Not even one bar of the given diameter fits within the width after cover and spacing. |
| 104 | BAR_LAYOUT_EXCEEDS_SECTION_HEIGHT | rectBeamBarLayout | The combined top and bottom rebar layers exceed the section height h. |
| 105 | SHEAR_STRENGTH_EXCEEDS_MAX | stirrupShearCapacity, checkStirrupRequirement | Vs exceeds 0.66·√f′c·bw·d; the section is too small for shear — increase bw or d. |
| Kind | Export | Returns | Description |
|---|---|---|---|
| FN | rectBeamMomentCapacity | { phiMn, calculationDetails, unit, warnings } | Design moment capacity φMn of a singly or doubly reinforced section |
| FN | concreteShearCapacity | { phiVc, calculationDetails, unit, warnings } | Concrete contribution to shear capacity φVc |
| FN | stirrupShearCapacity | { phiVs, calculationDetails, unit, warnings } | Stirrup contribution to shear capacity φVs |
| FN | checkStirrupRequirement | { required, minimumOnly, calculationDetails, unit, warnings } | Whether stirrups are required, and required Av/s and max spacing |
| FN | rectBeamBarLayout | { d, d_, top, bottom, unit, warnings } | Layered bar arrangement with resulting effective depths |
| FN | concreteBeta | number | ACI 318 β₁ stress-block factor |
| FN | concreteElasticModulus | number | Concrete elastic modulus Ec = 4700√f′c |
| FN | psiToMpa | number | psi → MPa conversion |