Overview

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.

ℹ️ All inputs and outputs use SI units implicitly: MPa for stresses, mm / mm² for geometry, kN·m for moments. Each result object states its unit in the unit field.
ℹ️ Code-provision violations that leave the calculation valid are returned as entries in the 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.
Input Types
RectSinglyBeamSection
Section with tension steel only: materials (Es, fy, f′c), geometry (b, h, d), and steel area As.
RectDoublyBeamSection
Extends the singly section with compression steel As′ at depth d′ from the compression face.
RectBeamBarLayoutInput
Section dimensions, top/bottom bar groups, and optional cover, stirrup diameter, and aggregate size.
RebarGroupInput
A group of same-diameter bars: count and diameter (mm).
Design Flow

The two main functions are designed to chain: the bar layout produces the effective depths that the capacity calculation consumes.

1
Lay out the reinforcement
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.
2
Compute the capacity
Feed d, d_, and the areas into rectBeamMomentCapacity together with the material properties to get φMn in kN·m.
3
Review the warnings
Check the merged warnings array for code-provision notes (e.g. minimum steel per ACI318-19, 9.6.1.2) before accepting the design.
Flexural Capacity rc-beam-design.ts
FN rectBeamMomentCapacity(section) Public API

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.

Parameters — RectBeamSection
ParamTypeUnitRequired?Description
EsnumberMPaRequiredElastic modulus of reinforcing steel (typically 200,000)
fc_numberMPaRequiredSpecified compressive strength of concrete f′c
fynumberMPaRequiredYield strength of reinforcing steel
Asnumbermm²RequiredArea of tension reinforcement
bnumbermmRequiredSection width
hnumbermmRequiredOverall section height
dnumbermmRequiredEffective depth to the tension steel centroid
As_numbermm²OptionalArea of compression reinforcement (doubly reinforced only)
d_numbermmOptionalDepth to the compression steel centroid from the compression face
Example
TypeScript
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
});
Returns
Result
{
  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.

⚠️ Pushes a warning when 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.
⚠️ Pushes a warning when fy exceeds 550 MPa — ACI318-19, 9.6.1.2.
⚠️ Pushes a warning when d_ exceeds the neutral-axis depth cACI318-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.
ℹ️ The solve first assumes the compression steel stays elastic. If the resulting fs_ reaches fy in either direction, equilibrium is re-solved with that steel at yield and fs_ is capped at ±fyACI318-19, 20.2.2.1.
⚠️ Throws RCDesignError 102 if the section is out of the tension-controlled region, i.e. εt < εty + 0.003 (ACI318-19, Table 21.2.2), since φ = 0.9 is applied unconditionally.
Shear Capacity 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.

FN concreteShearCapacity(section) Public API

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.

Parameters — RectShearSection
ParamTypeUnitRequired?Description
fc_numberMPaRequiredSpecified compressive strength of concrete f′c
bwnumbermmRequiredWeb width
dnumbermmRequiredEffective depth to the tension steel centroid
lambdanumberOptionalConcrete density modification factor (default 1.0, normal weight)
Example
TypeScript
import { concreteShearCapacity } from '@theerapat-s28/ts-structural-eng-tools/rc';

const result = concreteShearCapacity({
  fc_: 25,   // MPa
  bw: 250,  // mm
  d: 450,   // mm
});
Returns
Result
{
  phiVc: 71.72,           // φ = 0.75 applied, rounded to 2 dp
  calculationDetails: {
    Vc: 95.63,          // kN, unreduced
    lambda: 1
  },
  unit: 'kN',
  warnings: []
}
⚠️ Pushes a warning and caps √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.
FN stirrupShearCapacity(section) Public API

Calculates the stirrup contribution to shear capacity φVs per ACI318-19, 22.5.10.5.3: Vs = Av·fyt·d / s.

Parameters — StirrupShearSection
ParamTypeUnitRequired?Description
fc_numberMPaRequiredSpecified compressive strength of concrete f′c
bwnumbermmRequiredWeb width
dnumbermmRequiredEffective depth to the tension steel centroid
Avnumbermm²RequiredArea of shear reinforcement within spacing s (both legs)
fytnumberMPaRequiredYield strength of the stirrup steel
snumbermmRequiredStirrup spacing
Example
TypeScript
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
});
Returns
Result
{
  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: []
}
⚠️ Throws RCDesignError 105 if Vs exceeds 0.66·√f′c·bw·dACI318-19, 22.5.1.2. The section is too small for shear; increase bw or d.
FN checkStirrupRequirement(input) Public API

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.

Parameters — ShearReinforcementCheckInput
ParamTypeUnitRequired?Description
fc_numberMPaRequiredSpecified compressive strength of concrete f′c
bwnumbermmRequiredWeb width
dnumbermmRequiredEffective depth to the tension steel centroid
VunumberkNRequiredFactored shear force at the section
fytnumberMPaRequiredYield strength of the stirrup steel
Avnumbermm²OptionalProvided area of shear reinforcement within spacing s (both legs)
snumbermmOptionalProvided stirrup spacing
lambdanumberOptionalConcrete density modification factor (default 1.0, normal weight)
Example
TypeScript
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
});
Returns
Result
{
  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.

⚠️ Pushes a warning (ACI318-19, 9.6.3.1) when the provided Av / s is below the required ratio.
⚠️ Pushes a warning (ACI318-19, 9.7.6.2.2) when the provided spacing s exceeds the computed maximum spacing.
⚠️ Throws RCDesignError 105 if the strength-required Vs exceeds 0.66·√f′c·bw·d — the section is too small for the demand even with maximum stirrups.
Bar Layout rc-bar-layout.ts
FN rectBeamBarLayout(input) Public API

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.

Parameters — RectBeamBarLayoutInput
ParamTypeUnitRequired?Description
bnumbermmRequiredSection width
hnumbermmRequiredOverall section height
topBarsRebarGroupInputOptionalTop (compression) bar group: count, diameter (mm). Omit it for a section with no top reinforcement — d_ is then 0.
bottomBarsRebarGroupInputRequiredBottom (tension) bar group: count, diameter (mm)
covernumbermmOptionalClear cover to the stirrup (default 40)
stirrupDiameternumbermmOptionalStirrup bar diameter (default 10)
maxAggregateSizenumbermmOptionalNominal maximum aggregate size (default 20)
Example
TypeScript
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
});
Returns
Result
{
  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: []
}
ℹ️ The defaults for 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.
⚠️ Throws RCDesignError 103 if the section is too narrow to fit even one bar of the given diameter with the required cover and spacing.
⚠️ Throws RCDesignError 104 if the combined top and bottom layers exceed the section height h.
Material Helpers general.ts
FN concreteBeta(fc_) Public API

Returns 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.

Parameters
ParamTypeUnitRequired?Description
fc_numberMPaRequiredConcrete compressive strength f′c
Example
TypeScript
concreteBeta(28);  // → 0.85
concreteBeta(42);  // → 0.75
FN concreteElasticModulus(fc_) Public API

Estimates the modulus of elasticity of normal-weight concrete per ACI 318: Ec = 4700·√f′c (MPa).

Parameters
ParamTypeUnitRequired?Description
fc_numberMPaRequiredConcrete compressive strength f′c
Example
TypeScript
concreteElasticModulus(28);  // → 24870.06 MPa
FN psiToMpa(psi) Public API

Converts a pressure value from psi to MPa (divides by 145.038).

Parameters
ParamTypeUnitRequired?Description
psinumberpsiRequiredPressure in pounds per square inch
Example
TypeScript
psiToMpa(4000);  // → 27.58 MPa
RCDesignError Codes

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.

CodeNameThrown byMeaning
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.
Export Summary
KindExportReturnsDescription
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